Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: What about if (my $var = foo()) { ... }

by polettix (Vicar)
on Dec 30, 2007 at 14:42 UTC ( #659609=note: print w/ replies, xml ) Need Help??


in reply to What about if (my $var = foo()) { ... }

This issue was discussed -- "inside-out" -- some time ago, starting from this post from merlyn and more or less ending with this reply from TheDamian.

I would also add that the idiom could be useful even when the function is pure, but heavy on CPU. Just as a form of self-baked cache.

Hey! Up to Dec 16, 2007 I was named frodo72, take note of the change! Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf

Io ho capito... ma tu che hai detto?


Comment on Re: What about if (my $var = foo()) { ... }
Re^2: What about if (my $var = foo()) { ... }
by Limbic~Region (Chancellor) on Dec 30, 2007 at 15:50 UTC
    polettix,
    Thanks! I tried hard to find this thread when I posted this because I remembered it. Unfortunately, I misremembered TheDamian being the one providing the solution and thought he was the one asking the question. Using Super Search to find posts by TheDamian asking a question (not a reply) didn't help and so I gave up.

    Cheers - L~R

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (9)
As of 2014-09-20 16:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (160 votes), past polls