Nerver/Ever do this: my $foo = $bar if ($cond);
well, I met this a few days ago.
my $foo = $bar if ($cond);
makes a lot of trouble for me.
I view that this is talked in Catalyst maillist.
http://lists.scsys.co.uk/pipermail/catalyst/2007-July/thread.html#14484
And just for your attention, be careful!
example from mst:
guess what it is?
DO NEVER try code like this, instead try my $foo = ($cond) ? $bar : undef;
@Enjoy;
my $foo = $bar if ($cond);
makes a lot of trouble for me.
I view that this is talked in Catalyst maillist.
http://lists.scsys.co.uk/pipermail/catalyst/2007-July/thread.html#14484
And just for your attention, be careful!
example from mst:
sub foo { my $foo if 0; $foo++; }
print foo(), foo(), foo();guess what it is?
DO NEVER try code like this, instead try my $foo = ($cond) ? $bar : undef;
@Enjoy;
1 Comments:
sub foo { my $foo if 0; $foo++; }
print foo(), foo(), foo();
012
完成
Post a Comment
Links to this post:
Create a Link
<< Home