in reply to Re^4: Using a stored condition
in thread Using a stored condition

Am I doing something wrong here?
Yes. ETOOLAZY:
my $aa=1,$bb=1,$cc=1,$dd=1;

That's equivalent to

my $aa=1; $bb=1; $cc=1; $dd=1;

Only $aa is declared as lexical. Even parens don't work, since you can't declare an assignment - you declare variables.

But that's lazy enough:

my ($aa, $bb, $cc, $dd); $aa = $bb = $cc = $dd = 1;

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

Replies are listed 'Best First'.
Re^6: Using a stored condition
by blazar (Canon) on Mar 03, 2008 at 00:12 UTC
    Am I doing something wrong here?

    Yes. ETOOLAZY:

    my $aa=1,$bb=1,$cc=1,$dd=1;

    That's equivalent to

    my $aa=1; $bb=1; $cc=1; $dd=1;

    Only $aa is declared as lexical. Even parens don't work, since you can't declare an assignment - you declare variables.

    I personally believe ENOTLAZYENOUGH:

    my ($aa, $bb, $cc, $dd) = (1) x 4;

    (Which of course you knew, but may be worth pointing out for the benefit of the OP.)

    --
    If you can't understand the incipit, then please check the IPB Campaign.

      Good. But also:

      $_++ for my( $aa, $bb, $cc, $dd );