Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^4: Functional Programming & method rewriting

by SpanishInquisition (Pilgrim)
on Oct 29, 2004 at 12:50 UTC ( #403727=note: print w/replies, xml ) Need Help??


in reply to Re^3: Functional Programming & method rewriting
in thread Functional Programming & method rewriting

My fault. Ok, so replace ($gorp, $slug, @args) = shift() with ($gorp,$slug) = @_ and you get what I meant, ah well. Please shoot me for only testing with functions taking a single parameter :)

This stupid mistake of mine was related to me thinking @_ would be accidentally closed around the first block, which isn't true, because @_ is magic... (I was always using @_ before, so, umh, that's why it's odd).

  • Comment on Re^4: Functional Programming & method rewriting

Replies are listed 'Best First'.
Re^5: Functional Programming & method rewriting
by Anonymous Monk on Oct 29, 2004 at 20:24 UTC
    No it's not because @_ is magic (whatever that means) it's because @_ is localized. And a package Variable anyway.
Re^5: Functional Programming & method rewriting
by ikegami (Pope) on Oct 29, 2004 at 21:06 UTC
    Closures only grab lexicals (my variables). @_ is a package variable (local variable).

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2019-07-24 06:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If you were the first to set foot on the Moon, what would be your epigram?






    Results (32 votes). Check out past polls.

    Notices?