substr is also an lvalue sub, but its return value can also be magic...
$ perl -lwMstrict my $x="abcdefghi"; for (substr $x,1,3) { print; s/c/C/; print; } print $x; my $y = \substr $x,5,3; $$y=~s/g/G/; print $x; __END__ bcd bCd abCdefghi abCdefGhi
In reply to Re^4: regex syntax and idomatic Perl
by haukex
in thread regex syntax and idomatic Perl
by cbeckley
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |