I find this less than compelling, perhaps because I always use parenthesis on method or function calls. my $bar = new FOO(); isn't going to be tripped up by having written a new routine in the current package. Consider
Update: hold on, my $f = new FOO; # also prints "right!" Where's the problem?package FOO; sub new { print "right!\n"; } package BAR; sub new { print "wrong!\n"; } my $f = new FOO(); # prints "right!"
In reply to Re: Here's a quick example why not to use Indirect notation
by dws
in thread Perl High School
by hsweet
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |