in reply to Re: Re: Can't I chop the lvalue of join?
in thread Can't I chop the lvalue of join?

It does work on lvalues. But the return value of join() is not an lvalue. You can't assign to it. join('x', qw( a b c )) = "foo"; is a syntax error, whereas substr($x, 2, 4) = "ouch"; is not, so you can say chop(substr($x, 2, 4)).

_____________________________________________________
Jeff[japhy]Pinyan: Perl, regex, and perl hacker, who'd like a job (NYC-area)
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

Replies are listed 'Best First'.
Re^4: Can't I chop the lvalue of join?
by Aristotle (Chancellor) on Sep 28, 2002 at 18:07 UTC
    (Which, of course, is in this case a silly way to say the same as:)
    substr($x, 4, 1) = ''; # or substr($x, 4, 1, '');

    Makeshifts last the longest.