Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
Keep It Simple, Stupid
 
PerlMonks  

Re^4: Ampersands and sub speed

by spiritway (Vicar)
on Oct 16, 2005 at 01:09 UTC ( [id://500535]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re^3: Ampersands and sub speed
in thread Ampersands and sub speed

Mainly because it's *not* basic Perl. It's a subtle effect that isn't obvious. If the OP included the ampersands without commenting, it would be reasonable for a maintainer to remove them, not knowing the effect they have on speed. And as you are fond of pointing out, not everyone who programs is a good programmer, right?

Replies are listed 'Best First'.
Re^5: Ampersands and sub speed
by tinita (Parson) on Oct 16, 2005 at 08:51 UTC
    It's a subtle effect that isn't obvious.
    well, it's documented in the beginning of perlsub.pod. i want to program assuming my co-workers/successors have at least read the common perldoc-pages. i don't want to comment things that are already documented in the documentation for perl itself.
    what i *would* docunment in a case like this is *why* i do this. so instead of saying
        &foo; # give current @_ to foo.
    i'd say
        &foo; # foo needs @_ because ...
    then any programmer stumbling over this code would know why or have to read perlsub.

      The effect I was referring to was the increase in speed, and not the visibility of @_. This effect is not documented in perlsub, as far as I have been able to determine.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://500535]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.