Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Use of uninitialized value $_ in string

by toolic (Bishop)
on Apr 05, 2014 at 13:33 UTC ( [id://1081241]=note: print w/replies, xml ) Need Help??


in reply to Use of uninitialized value $_ in string

my $conf = "$_";
I suspect the warning is coming from that line (which is not line 32 in the code you posted). I don't think you ever set the $_ special variable before you used it. Also, there is usually no reason to place quotes around a scalar variable. Also, what you get is a warning, not an error. It appears because you use warnings;, which is a good idea because it notifies you that there is something unexpected in your code.

The other errors you see are like due to coping with scoping.

Replies are listed 'Best First'.
Re^2: Use of uninitialized value $_ in string
by juanpablo (Novice) on Apr 05, 2014 at 14:06 UTC

    Hi toolic!

    Thanks for the reply! I appreciate it.

    Yes, you're right. I've just realized that that variable shouldn't be declared on top. I've removed it already and put it back in foreach body. Also, the errors were gone but I'm not sure if that's the right thing to do, I mean the declaration of variables again in the sub part. I'm checking the coping with scoping thread now. :)

    Cheers,

    JP

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-19 04:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found