http://qs1969.pair.com?node_id=44096

This snippet shows how to use an expression as an lvalue. It's based on something my boss said you could only do in Algol68.
($a,$b) = (0,1); ($a < $b ? $a : $b) = $a+$b for (1..$n); print $n%2 ? $a : $b, "\n"

Replies are listed 'Best First'.
Re: Fibonacci numbers with lvalues
by Adam (Vicar) on Dec 01, 2000 at 07:11 UTC
    Heh, that's pretty cool.

    (For a moment there I was gonna point out that you missed the whole Fibonacci thread, but your post isn't really about the series, its about assigning to an expression.)

    ARGH! Thanks to the power of Preview I was checking that link and discovered that half the Fibonacci thread is missing (the TOP half!) I'll have to msg Vroom about that. Part of the bottom half of that thread is RE: RE (tilly) 1: Fibonnaci. Notice the links to the top half don't exist. Very weird.