20 July 2007
This post may be outdated due to it was written on 2007. The links may be broken. The code may be not working anymore. Leave comments if needed.
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:
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;


blog comments powered by Disqus