Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^4: Calling a sub from a variable ?

by ZlR (Chaplain)
on Mar 22, 2005 at 13:44 UTC ( [id://441451]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Calling a sub from a variable ?
in thread Calling a sub from a variable ?

I know , I tend to be a little bit on the agressive side sometimes, but i was the one feeling jumped upon.
Maybe one should be carefull before giving such advice ...
"Walk a mile in my shoes ..."
And you do note that the IO comment is interesting but wrong .
i know it's no reason to get nervous, i'm just over-reactive sometimes ... well

Keep the spirit,
zen le renard

Replies are listed 'Best First'.
Re^5: Calling a sub from a variable ?
by dragonchild (Archbishop) on Mar 22, 2005 at 14:07 UTC
    And you do note that the IO comment is interesting but wrong .

    Actually, the I/O comment by AnonyMonk is correct in most situations. Now, it may not be correct in your specific setup, but I would have done some Benchmarks before making an offhand comment like that. Or, maybe I would have used Devel::DProf to determine what was taking up a lot of time in my application - I/O or eval.

    Being right, does not endow the right to be rude; politeness costs nothing.
    Being unknowing, is not the same as being stupid.
    Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
    Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

      I don't know, dragonchild .
      Unix logics make me think that the evaled code would be in memory as soon as the second call to eval on the same function . I'd say the IO argument stands only if you eval things only once .

        It can't work that way. The same string may not compile to the same optree, depending on how the environment around it has changed. For example, which one does my $x = new Foo (1, 2, 3); compile to?
        • my $x = new(Foo(1,2,3));
        • my $x = Foo->new(1,2,3);

        Depending on if the Foo package has been loaded already, it can be either one. Thus, eval STRING will incur the compilation penalty every time.

        Being right, does not endow the right to be rude; politeness costs nothing.
        Being unknowing, is not the same as being stupid.
        Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
        Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-10 06:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found