Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^3: RFC: Defined-Or for before Perl 5.10

by ikegami (Pope)
on Nov 10, 2010 at 22:48 UTC ( #870715=note: print w/ replies, xml ) Need Help??


in reply to Re^2: RFC: Defined-Or for before Perl 5.10
in thread RFC: Defined-Or for before Perl 5.10

sub _defined { if (defined($_[0])) { return $_[0]; } else { return $_[1]->(); } } sub _or(&) { return $_[0]; } my $pid = _defined fork(), _or { die "Can't fork: $!" };

I'll let you pick better names.

Update: Nevermind. If you try to pick useful names, you end up back with

my $pid = defined_or fork(), sub { die "Can't fork: $!" };


Comment on Re^3: RFC: Defined-Or for before Perl 5.10
Select or Download Code

Log In?
Username:
Password:

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

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

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











    Results (379 votes), past polls