Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: trouble taking reference of function

by ikegami (Patriarch)
on Mar 03, 2009 at 21:25 UTC ( [id://747904]=note: print w/replies, xml ) Need Help??


in reply to Re: trouble taking reference of function
in thread trouble taking reference of function

Beware of prototypes when dealing with functions and named operators.
$ perl -wle'print sin(0.5) == sub { sin(@_) }->(0.5) ?1:0' 0 $ perl -wle'print sin(0.5) == sub { sin($_[0]) }->(0.5) ?1:0' 1

Update: Added code.

Replies are listed 'Best First'.
Re^3: trouble taking reference of function
by Lawliet (Curate) on Mar 03, 2009 at 22:00 UTC

    Huh? Why does that happen?

    And you didn't even know bears could type.

        Oh, so it returns the sine of the number of elements passed to the function, right?

        And you didn't even know bears could type.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2024-04-26 07:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found