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 !