Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Problem when - use strict and -w

by toolic (Bishop)
on Jul 14, 2009 at 20:42 UTC ( [id://780071]=note: print w/replies, xml ) Need Help??


in reply to Problem when - use strict and -w

When I run your code without -w or use strict;, I get no complaints. However, when I run it with -w, I get your "uninitialized value" warnings, and I get the following warning:
Name "main::row" used only once: possible typo at ...

From this line of code:

$row[0], "\"", " ", $row->[4], ^^^^

Did you see this warning too?

You should fix that error and continue to use strict and warnings.

Replies are listed 'Best First'.
Re^2: Problem when - use strict and -w
by GertMT (Hermit) on Jul 14, 2009 at 21:14 UTC
    Thank you both for your prompt reply.
    I had been staring at the code for a while but didn't see the typo in my code. Seemed that in the real code an empty last line of the data.txt also gave some problem. I'll find my way out of that (tomorrow, as it's too late here by now)
    And yes, I'll continue to use strict and warnings!
    Thanks again.
      As an aside, you could reduce the amount of typing by using qq in your print:
      print "Olah:\t", $number++, qq(\t$row->[2] "$row->[5]"\t"$row->[3]$row->[0]" $row->[4]\n);

      I'm not sure if it's any prettier, but it is easier to type than all those commas and quotes and back-whacked quotes.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2024-04-26 03:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found