Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
for my $a (0, 1) { for my $b (0, 1) { print "c1 : $a, $b, ", c1($a, $b), "\n"; print "c2 : $a, $b, ", c2($a, $b), "\n"; } } sub c1 { my ($a, $b) = @_; $a and not $b } sub c2 { my ($a, $b) = @_; return $a and not $b }
output
c1 : 0, 0, 0 c2 : 0, 0, 0 c1 : 0, 1, 0 c2 : 0, 1, 0 c1 : 1, 0, 1 c2 : 1, 0, 1 c1 : 1, 1, c2 : 1, 1, 1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: To return and/or not?
by BrowserUk (Patriarch) on Oct 07, 2011 at 23:57 UTC | |
|
Re: To return and/or not?
by roboticus (Chancellor) on Oct 08, 2011 at 00:06 UTC | |
|
Re: To return and/or not?
by moritz (Cardinal) on Oct 08, 2011 at 05:26 UTC | |
by Anonymous Monk on Oct 08, 2011 at 09:32 UTC | |
by moritz (Cardinal) on Oct 08, 2011 at 11:21 UTC | |
by choroba (Cardinal) on Oct 08, 2011 at 09:50 UTC | |
by Anonymous Monk on Oct 08, 2011 at 10:10 UTC | |
by choroba (Cardinal) on Oct 08, 2011 at 10:12 UTC | |
by Anonymous Monk on Oct 08, 2011 at 10:13 UTC | |
by Anonymous Monk on Oct 08, 2011 at 10:37 UTC | |
by Anonymous Monk on Oct 08, 2011 at 10:59 UTC |