sub trim { for (my $s = $_[0]) { # passed param assigned, not used s/^\s+//; # substitutions on $_ ...
Actually, it works... it's only written in a somewhat weird fashion :)
The passed parameter is assigned to $s, which is then aliased to $_ by the for loop... The seemingly superfluous $s is needed, because otherwise you'd get the error "Modification of a read-only value attempted". But I agree there are more readable versions...
In reply to Re^2: Still having problems with spanish characters
by almut
in thread Still having problems with spanish characters
by qnguyen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |