|
|
| We don't bite newbies here... much | |
| PerlMonks |
Re: Is this reliable?by tobyink (Prior) |
| on Feb 18, 2013 at 16:43 UTC ( #1019363=note: print w/ replies, xml ) | Need Help?? |
|
Perl has some special constants that it returns as true and false in response to comparisons and some other boolean expressions. You can peek at the internals of these constants using Devel::Peek:
Interesting observations:
I'm not going to say that these constants are never going to change (never say never!) but it would probably break a lot of code if they did, so I think p5p would be pretty wary of changing this. The Enterprise operator (see perlsecret) relies on them numifying as 0 and 1.
package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||