I think this would (in the case $change_in_place && $default_argument) change only a copy of $_, not $_ itself. Maybe one could somehow use a foreach loop iterating over a one-element list, but I don't see how this would work in the general case.my $str = $change_in_place && $default_argument ? $_ : $_[0]; $str =~ s/^($lchompstr)*//; $_[0]; }
In reply to Re^2: How can I avoid code repetition here
by rovf
in thread How can I avoid code repetition here
by rovf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |