Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: $^W or require warnings and import warnings;

by biosysadmin (Deacon)
on Jun 15, 2005 at 18:21 UTC ( [id://467001]=note: print w/replies, xml ) Need Help??


in reply to Re: $^W or require warnings and import warnings;
in thread $^W or require warnings and import warnings;

Good call, this definitely doesn't work the way the author intended. I wondered the same thing initially and tried something eerily similar to your code, but it seemed to warn me on both print statements. When I read your post I was definitely surprised for a few seconds, until I looked at the top of my script and found this:
#!/usr/bin/perl -w
So, removing the -w gave me the output you describe.

I use perl -w in most of my scripts, so it's in my VIM template for Perl scripts. Further proof that it's important to remember your coding habits, lest they sneak up on you when you least expect it. :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-03-29 01:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found