in reply to why does 'print ("hey)")' give a warning?

BTW:

is "use warning" the same like #!/usr/bin/perl -w

???

Ciao

  • Comment on Re: why does 'print ("hey)")' give a warning?

Replies are listed 'Best First'.
Re: Re: why does 'print ("hey)")' give a warning?
by tachyon (Chancellor) on Jul 09, 2001 at 14:27 UTC

    use warnings; is only available on Perl 5.6.0 on up. -w works on all platforms (unix/win/mac/etc) with a Perl that supports warnings because the /perl executable looks for shebang line options regardless of whether the that platform actually uses the shebang line per se to target the perl exe. So to make your code backwards compatible with the still extremely common perl 5.5 use -w. You will find more discussion of this here use warnings vs. perl -w

    cheers

    tachyon

    s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Re: Re: why does 'print ("hey)")' give a warning?
by CharlesClarkson (Curate) on Jul 09, 2001 at 17:56 UTC

    Take a look at perllexwarn (Perl Lexical Warnings) for way too much detail on the differences between use warnings;, -w, and $^W.

    HTH,
    Charles K. Clarkson
Re: Re: why does 'print ("hey)")' give a warning?
by John M. Dlugosz (Monsignor) on Jul 09, 2001 at 23:54 UTC
    Same idea, but better. You can enable or disable specific warnings, define your own in your modules, and scope the settings. It doesn't set the same variable that -w does, BTW, if you code is looking at that.