in reply to my behavior with "NULL" declarations
( (shift @ARGV) ? (my $foo) : (my $bar) ) = "Hello";
Except, you don't know which variable has been assigned to. (Due to an oddity with my's behavior, both variables will be declared. One will be undef, though.)
And, this type of thing is better done with hashes, but you knew that.
------
We are the carpenters and bricklayers of the Information Age.
Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose
I shouldn't have to say this, but any code, unless otherwise stated, is untested
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: my behavior with "NULL" declarations
by ysth (Canon) on Jul 08, 2004 at 17:54 UTC | |
|
Re^2: my behavior with "NULL" declarations
by dsb (Chaplain) on Jul 08, 2004 at 18:11 UTC | |
by dragonchild (Archbishop) on Jul 08, 2004 at 18:18 UTC |