throop has asked for the wisdom of the Perl Monks concerning the following question:
Brethren,
Perl Best Practices (p 176) deprecates using an & before function calls, i.e. it prefers
instead ofsnafu();
But all of the examples seemed like places where already-bad coding was made worse by &; not real convincing. I continue to use the & because&snafu;
- EMACS displays &function; as &function; and the color contrast helps me navigate in the code
- It's the way I learned to do it back in Perl 4; some of my code dates all the way back there, and I just keep a visual consistency to it all.
I was surprised to learn today
Be warned that Perl does not check prototypes when a subroutine call includes the & prefix.But that seems more like a reason not to use prototypes than not to use &
Outside aesthetics, are there compelling reasons not to use the &? Compelling enough to make me go back and clean-up my already-written code that uses them?
throop
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Using & in function calls
by Joost (Canon) on Sep 28, 2007 at 23:47 UTC | |
by demerphq (Chancellor) on Oct 02, 2007 at 08:30 UTC | |
by Joost (Canon) on Oct 02, 2007 at 21:12 UTC | |
Re: Using & in function calls
by Sidhekin (Priest) on Sep 28, 2007 at 23:01 UTC | |
by lodin (Hermit) on Sep 29, 2007 at 16:08 UTC | |
Re: Using & in function calls
by TimToady (Parson) on Sep 29, 2007 at 17:10 UTC | |
Re: Using & in function calls
by FunkyMonk (Chancellor) on Sep 28, 2007 at 22:55 UTC | |
Re: Using & in function calls (classic)
by tye (Sage) on Sep 29, 2007 at 05:43 UTC | |
Re: Using & in function calls
by Porculus (Hermit) on Oct 03, 2007 at 17:41 UTC |
Back to
Seekers of Perl Wisdom