Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
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.

Replies are listed 'Best First'.
Re^2: Why is this evaluating to true?
by SuicideJunkie (Vicar) 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';
Re^2: Why is this evaluating to true?
by pmarcoen (Novice) on Nov 16, 2011 at 13:11 UTC
    Aha ! Thanks, good answer !

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 wandering the Monastery: (8)
As of 2016-06-30 22:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (404 votes). Check out past polls.