Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Why is this evaluating to true?

by lidden (Deacon)
on Nov 16, 2011 at 13:04 UTC ( #938366=note: print w/ replies, xml ) Need Help??


in reply to Why is this evaluating to true?

The string "test" is zero when perl makes it numeric. I don't remember where that is documented but "test" is zero and e.g. "2test" is two.


Comment on Re: Why is this evaluating to true?
Select or Download Code
Re^2: Why is this evaluating to true?
by pmarcoen (Novice) on Nov 16, 2011 at 13:11 UTC
    Aha ! Thanks, good answer !
Re^2: Why is this evaluating to true?
by SuicideJunkie (Priest) on Nov 16, 2011 at 14:20 UTC

    You can use that feature for less-magic numbers in quick scripts. Eg:

    my $time = $minutes / '60 minutes per hour' / '8 hour workdays';

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://938366]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2014-09-21 22:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (176 votes), past polls