in reply to Re: Re: using glob to get files
in thread using glob to get files
To quote the good book (Camel, 2nd ed., p115) almost verbatim:
&foo(1,2,3); # pass three arguments. foo(1,2,3); # the same. foo(); # pass a null list. &foo(); # the same. &foo; # foo() gets current args, like foo(@_) !! foo; # like foo() IFF sub foo pre-declared, else bareword "fo +o".
The ampersand also disables any prototype checking on arguments not provided.
Which means that under certain circumstances, using the ampersand can lead to unexpected results, so in my case, I tend to avoid it in all sub calls, so I don't have to remember the details.
But I never called it evil, I just wanted folks to be aware that putting an ampersand in front of a sub call has odd behavior when no explicit arguments are passed. when I first read the Camel book, this section made me cringe.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: using glob to get files
by Anomynous Monk (Scribe) on Mar 12, 2004 at 18:43 UTC |