in reply to Re: First char out of a string & surprises with errors on chop reverse $string (that doesn't work!)
in thread First char out of a string & surprises with errors on chop reverse $string (that doesn't work!)
Ok... we'd figured that far when jeffa got:
Now, my question is... that's not very "DWIM" of perl... (at least not to me!) Why does reverse not return an lvalue?sub bar { my $str = "foo"; return scalar reverse $str; } print chop bar(); captvanhalen: $ perl foo Can't modify non-lvalue subroutine call in chop at foo line 6, near " +);" Execution of foo aborted due to compilation errors.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: First char out of a string & surprises with errors on chop reverse $string (that doesn't work!)
by merlyn (Sage) on Dec 26, 2001 at 21:55 UTC | |
by eduardo (Curate) on Dec 26, 2001 at 22:03 UTC | |
by Juerd (Abbot) on Dec 26, 2001 at 22:08 UTC | |
Re: Re: Re: First char out of a string & surprises with errors on chop reverse $string (that doesn't work!)
by Juerd (Abbot) on Dec 26, 2001 at 21:56 UTC |
In Section
Seekers of Perl Wisdom