in reply to Re^5: An overlapping regex capture
in thread An overlapping regex capture
No, you got the error saying that $filename.fa is uninitialized. So perl saw that as a variable name ...
Sorry, but that's not correct in this case, a dot does end the variable name being interpolated. As the OP is using strict, that would have caught the error anyway. Your advice does apply for other characters though.
$ perl -wMstrict -le 'my $fn="x"; print "$fn.y"' x.y $ perl -wMstrict -le 'my $fn="x"; print "$fn_y"' Global symbol "$fn_y" requires explicit package name (did you forget t +o declare "my $fn_y"?) at -e line 1. Execution of -e aborted due to compilation errors. $ perl -w -le 'my $fn="x"; print "$fn_y"' Name "main::fn_y" used only once: possible typo at -e line 1. Use of uninitialized value $fn_y in string at -e line 1. $ perl -wMstrict -le 'my $fn="x"; print "${fn}_y"' x_y
|
---|