Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^4: Functional Programming & method rewriting

by SpanishInquisition (Pilgrim)
on Oct 29, 2004 at 12:50 UTC ( [id://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 (Patriarch) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://403727]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-04-19 01:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found