Open dseynhae opened 3 years ago
I have a $splittervariable which is a parameter of one of my subroutines:
$splitter
my $splitter = qr{ [,\s]+ # Sequence of commas/spaces (?= # Start of instruction '[' [[] ) }smx; my $list_items = import_list_items( $list, $splitter );
Inside the subroutine:
sub import_list_items { my ( $input, $splitter ) = @_; # Default splitter: commas and spaces if ( !( defined $splitter ) ) { $splitter = qr/[,\s]+/smx; }
I am monitoring the content of splitter in the debugger (both as a "locals" variable and an expression in the "watch" window).
splitter
However, as soon as the qr expression is assigned to the variable:
qr
undef
Not sure if this is intended behavior, but it certainly isn't what I expect: something like:
(?^msx: [,\s]+ # Sequence of commas/spaces (?= # Start of instruction '[' [[] ) )
I have a
$splitter
variable which is a parameter of one of my subroutines:Inside the subroutine:
I am monitoring the content of
splitter
in the debugger (both as a "locals" variable and an expression in the "watch" window).However, as soon as the
qr
expression is assigned to the variable:undef
Not sure if this is intended behavior, but it certainly isn't what I expect: something like: