in reply to Re: Barewords equal zero?
in thread Barewords equal zero?

I noticed you changes the OP's code to something that strict wouldn't catch...

But you're right.
strict will catch some things.
warnings will catch others.
Both have their uses.

Replies are listed 'Best First'.
Re^3: Barewords equal zero?
by rgiskard (Hermit) on Feb 13, 2008 at 15:47 UTC

    In the previous example, I put quotes around the capital letter O. Because, quite frankly, barewords are painful.

    It's also important to look at it from the perspective of someone fixing the barewords but not fixing the real problem, as some may read the capital letter O and think it to be a zero (0) and brute force the solution by getting rid of the barewords by quoting everything.

    So without warnings, there's no difference between a quoted letter O and a quoted number 0. If one is starting out with the language then hopefully I've pointed out some positives about strict and warning.

    example with a quoted number zero
    use strict; use warnings; my $string = 'hello world'; print substr($string,'0',5)."\n";
    output
    sh-3.2$ perl absurd2.pl hello