Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

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. :)

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2020-06-01 00:29 GMT
Find Nodes?
    Voting Booth?
    If programming languages were movie genres, Perl would be:

    Results (177 votes). Check out past polls.