Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Prototype "foo {...} bar {...}" is documented?

by diotalevi (Canon)
on Nov 22, 2004 at 00:12 UTC ( [id://409458]=note: print w/replies, xml ) Need Help??


in reply to Prototype "foo {...} bar {...}" is documented?

Any discussion on this should note that this syntax is noted in perlsub and that code relying on this has an increased likelyhood to leak memory. It isn't a particularly good perl idiom but mostly because of the various implementation considerations that are particularly noxious.
  • Comment on Re: Prototype "foo {...} bar {...}" is documented?

Replies are listed 'Best First'.
Re^2: Prototype "foo {...} bar {...}" is documented?
by gmpassos (Priest) on Nov 22, 2004 at 00:35 UTC
    Yes, is documented with this example:
    sub try (&@) { my($try,$catch) = @_; eval { &$try }; if ($@) { local $_ = $@; &$catch; } } sub catch (&) { $_[0] } try { die "phooey"; } catch { /phooey/ and print "unphooey\n"; };
    Thanks I missed that.

    Graciliano M. P.
    "Creativity is the expression of liberty".

Re^2: Prototype "foo {...} bar {...}" is documented?
by Prior Nacre V (Hermit) on Nov 22, 2004 at 11:49 UTC
    ... that code relying on this has an increased likelyhood to leak memory.

    Any information on how the memory leakage occurs, and ways to avoid it, would be appreciated.

    Regards,

    PN5

        Thanks for taking the time to dig up that link.

        Regards,

        PN5

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://409458]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2025-07-20 05:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.