Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

(tye)Re: use warnings vs. perl -w

by tye (Cardinal)
on Jan 24, 2001 at 18:40 UTC ( #53975=note: print w/ replies, xml ) Need Help??


in reply to use warnings vs. perl -w

Under Windows you should start all of your scripts with

#!/usr/bin/perl -w
Surprised? Note that this won't tell the operating system to look for perl.exe in the /usr/bin directory. It will tell perl to turn on warnings, even on Windows, even without Apache. Oh, when using Apache, you'd want the real path to perl.exe instead of /usr/bin/perl, since, as you know, Apache looks at the #! line.

I don't use warnings as that will prevent my code from compiling prior to Perl 5.6 and it is still way too early to yell at anyone for running pre-5.6 versions of Perl. (:

        - tye (but my friends call me "Tye")


Comment on (tye)Re: use warnings vs. perl -w
Select or Download Code
Re: (tye)Re: use warnings vs. perl -w
by $code or die (Deacon) on Jan 24, 2001 at 20:59 UTC
    You're right, it does work, but I just tried this:
    #!/usr/bin/perl -w print "Content-Type: text/html\n\n"; $t = "hello world"; print "$h, $t";
    It doesn't complain about $h being uninitialised. It does however, if you take out the HTTP header.

    Update: I was running this on a Win32 webserver.

    Is that the way it should be?

    $code or die
    Using perl at
    The Spiders Web

      For me it complains either way, as it should.

              - tye (but my friends call me "Tye")
      If you are running under a webserver, the non-fatal errors my be hiding in the error log of your server or may even have been piped away to nothing, rather depends on the webserver. Check the error logs and see.

      --
      $you = new YOU;
      honk() if $you->love(perl)

        When I want to capture my warnings while running programs under IIS, I open STDERR to a text log file and then look in there for information.
      These days, the -w command line flag is usually replaced with the warnings pragma, as the latter is more flexible, and has scope that is limited to the enclosing block, while -w is global in effect.
Re: (tye)Re: use warnings vs. perl -w
by dug (Chaplain) on Jul 17, 2002 at 16:35 UTC

    And here I was thinking it was time to yell at people for not using 5.8.0 RC3 in production. For that matter, Sean O'Rourke has submitted a Perl6 grammar patch to Parrot. <grin>

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (11)
As of 2014-10-22 09:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (114 votes), past polls