in reply to Style, style, style

-w or use warnings;?

Has my memory completely left me, or is -w ignored under NT, hence introduction if pragma?


cLive ;-)


Replies are listed 'Best First'.
Re^2: Style, style, style
by Aristotle (Chancellor) on Sep 08, 2002 at 17:24 UTC
    It is ignored when on the shebang since Win doesn't have the shebang notion. You have to put it in the .pl filetype association in the registry. CGI scripts run by Apache don't have such a problem since the daemon will emulate the shebang notion on Win variants.

    Makeshifts last the longest.

      I can't talk for all perl builds on Windows, but my Activestate 5.6.1 (build 633) + Win2k does translate -w on the shebang to use warnings. It doesn't do it via using the shebang afaik, but just by using some magic on it.

      //: C:\ #!/usr/bin/perl -w $x = "foo"; __END__ output: Name "main::x" used only once: possible typo at line 2 ///~ C:\> MyScript