in reply to Barewords equal zero?
An example for the lazy folks out there, that demonstrates (for beginners) why warnings would be useful in addition to strict.
using strict onlyOutput doesn't really scream don't use the letter O:use strict; my $string = 'hello world'; print substr($string,'O',5)."\n";
using strict and warningsperl absurd.pl hello
Useful output with some notes on what should be a number and isn't:use strict; use warnings; my $string = 'hello world'; print substr($string,'O',5)."\n";
perl absurd.pl Argument "O" isn't numeric in substr at absurd.pl line 4. hello
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Barewords equal zero?
by ikegami (Patriarch) on Feb 12, 2008 at 21:12 UTC | |
by rgiskard (Hermit) on Feb 13, 2008 at 15:47 UTC |
In Section
Seekers of Perl Wisdom