http://qs321.pair.com?node_id=134433


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:
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.
Now, my question is... that's not very "DWIM" of perl... (at least not to me!) Why does reverse not return an lvalue?