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

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: $!" };

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://870715]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (10)
As of 2017-06-25 17:53 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (568 votes). Check out past polls.