in reply to lvalues and action at distance

Too much work. You can do this without tying:
sub append :lvalue { no warnings 'uninitialized'; substr($_[0], length $_[0]); } my $x; for (1 .. 5) { append($x) = $_ } print $x;

Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart

Replies are listed 'Best First'.
Re^2: lvalues and action at distance
by blazar (Canon) on Oct 11, 2005 at 15:03 UTC
    Well, but that still uses substr's magic. I took appending to a string as an example, but it was meant to illustrate a more general issue...