PerlOnTheWay has asked for the wisdom of the Perl Monks concerning the following question:
sub func { my ($delimiter, $text) = @_; return 1 and 0; } use Data::Dumper; print Dumper(func());
guess what?
the result is $VAR1 = 1;
anyone knows the reason?
seems that Perl gives return the same priority as an ordinary sub,is this really a good design?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Can you explain the result?
by choroba (Cardinal) on Dec 06, 2011 at 13:26 UTC | |
by Anonymous Monk on Dec 06, 2011 at 13:32 UTC | |
by choroba (Cardinal) on Dec 06, 2011 at 13:33 UTC | |
by Anonymous Monk on Dec 06, 2011 at 13:36 UTC | |
by Utilitarian (Vicar) on Dec 06, 2011 at 14:17 UTC | |
by MidLifeXis (Monsignor) on Dec 06, 2011 at 18:01 UTC | |
by Anonymous Monk on Dec 06, 2011 at 15:09 UTC | |
|
Re: Can you explain the result?
by RMGir (Prior) on Dec 06, 2011 at 13:20 UTC | |
by PerlOnTheWay (Monk) on Dec 06, 2011 at 13:24 UTC | |
by RMGir (Prior) on Dec 06, 2011 at 13:34 UTC | |
| |
|
Re: Can you explain the result?
by TJPride (Pilgrim) on Dec 06, 2011 at 16:33 UTC |