Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re^3: Barewords equal zero?

by rgiskard (Hermit)
on Feb 13, 2008 at 15:47 UTC ( #667783=note: print w/ replies, xml ) Need Help??

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

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";
sh-3.2$ perl hello

Comment on Re^3: Barewords equal zero?
Select or Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://667783]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2015-10-06 21:20 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (161 votes), past polls