Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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

by biosysadmin (Deacon)
on Jun 15, 2005 at 18:21 UTC ( #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. :)


Comment on Re^2: $^W or require warnings and import warnings;
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2014-10-02 01:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (41 votes), past polls