in reply to Re: Still having problems with spanish characters
in thread Still having problems with spanish characters

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...

Replies are listed 'Best First'.
Re^3: Still having problems with spanish characters
by Anonymous Monk on Sep 29, 2007 at 00:55 UTC
    it's only written in a somewhat weird fashion

    somewhat weird...?!?!?