in reply to What are the brackets in this for ?
As well as the potential for inlining that has already been pointed out, you also get a compile time error if you inadvertently introduce something that could be interpreted as an argument to the constant subroutine, see for instance this stupid example:
You get the error from the BAR 1 whereas the FOO 1 is undetected, obviously in real code this could possibly be much less obvious and lead to subtle bugs.sub FOO { 1; } + sub BAR () { 2; } + my $foo = FOO 1; + my $bar = BAR 1;
/J\
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: What are the brackets in this for ?
by bunnyman (Hermit) on May 22, 2006 at 14:14 UTC | |
by gellyfish (Monsignor) on May 22, 2006 at 14:27 UTC | |
by blazar (Canon) on May 22, 2006 at 14:24 UTC |