Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: help with "use strict" and code organization

by Cody Pendant (Prior)
on Apr 24, 2008 at 02:35 UTC ( [id://682546]=note: print w/replies, xml ) Need Help??


in reply to help with "use strict" and code organization

One possible reason for this problem is that you've defined them using my, but you've defined them in the wrong place.

For instance, if you've done

if($foo){ my $bar = 'baz'; } print $bar;
Then you'll get the warning that $bar is undefined, because it only exists inside the "if" block.

In other words, just adding my anywhere you declare a variable isn't going to solve your strict problems. You have to know what it means for those variables.



Nobody says perl looks like line-noise any more
kids today don't know what line-noise IS ...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-24 07:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found