Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
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 learning in the Monastery: (2)
As of 2024-06-23 07:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.