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