Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

pragmas are good

by am0c (Initiate)
on Mar 13, 2011 at 19:11 UTC ( [id://892979]=note: print w/replies, xml ) Need Help??


in reply to I can't figure out what's wrong with this foreach loop

And this is why you should use 'strict' and 'warnings' pragma in practice. You would have found the bug earlier if you had had these pragmas turned on. As you would have seen a warning saying 'undefined variable is being used.'

Replies are listed 'Best First'.
Re: pragmas are good
by ikegami (Patriarch) on Mar 13, 2011 at 19:18 UTC
    He does have warnings turned on, and his code doesn't issue that warning. @test is an array; it cannot be undefined.
      Yep, that did it. I knew it was something silly. I'll make sure to turn on strict from now on, too. Thanks again! Bryan

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-25 17:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found