Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Why is this evaluating to true?

by lidden (Curate)
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 surveying the Monastery: (6)
As of 2015-07-03 16:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (54 votes), past polls