Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re^2: Can you explain the result?

by PerlOnTheWay (Scribe)
on Dec 06, 2011 at 13:24 UTC ( #942016=note: print w/replies, xml ) Need Help??

in reply to Re: Can you explain the result?
in thread Can you explain the result?

shouldn't  1 and 0 be false/0?

Replies are listed 'Best First'.
Re^3: Can you explain the result?
by RMGir (Prior) on Dec 06, 2011 at 13:34 UTC
    As choroba said, return 1&&0 is different from return 1 and 0.

    $ perl -MB::Deparse -e' sub f{return 1 and 0;}; sub g{return 1 && 0}; $deparse=B::Deparse->new(); print "f(): ",$deparse->coderef2text(\&f),"\n"; print "g(): ",$deparse->coderef2text(\&g),"\n";' f(): { 0 if return 1; } g(): { return 0; }

      I think it's bad design
        It makes
        open my $FH, '<', $filename or die $!;
        and is similar to shell's
        mkdir $dir || exit 1
        But, of course, you can think whatever you want.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2018-02-20 09:54 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (268 votes). Check out past polls.