#!/usr/bin/perl use warnings; use strict; $\ = $/; my $A = "1112" # . '' ; @_ = ( 'a' .. 'i' ); $A =~ /1+ (??{ print "[$&]"; $_ .= shift @_; s!\B!shift@_!e; print "\$_:[$_]"; }) $ /x; #### [111] $_:[1b112a] [11] $_:[1db112ac] [1] $_:[1fdb112ace] [11] $_:[1hfdb112aceg] [1] Use of uninitialized value within @_ in substitution iterator at ./strange_ARG_inside_regex.pl line 18. $_:[1hfdb112acegi] [1] Use of uninitialized value in concatenation (.) or string at ./strange_ARG_inside_regex.pl line 17. Use of uninitialized value within @_ in substitution iterator at ./strange_ARG_inside_regex.pl line 18. $_:[1hfdb112acegi] #### #!/usr/bin/perl use warnings; use strict; $\ = $/; my $A = "1112" . '' ; @_ = ( 'a' .. 'i' ); $A =~ /1+ (??{ print "[$&]"; $_ .= shift @_; s!\B!shift@_!e; print "\$_:[$_]"; }) $ /x; #### [111] $_:[1b112a] [11] $_:[1db112ac] [�] $_:[1fdb112ace]