Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: use warnings vs. perl -w

by chipmunk (Parson)
on Jan 24, 2001 at 19:23 UTC ( #53994=note: print w/replies, xml ) Need Help??


in reply to use warnings vs. perl -w

As tye said, you can use #!perl -w on Windows. In fact, you can use the #! line on any platform to specify options. perlrun explains why:
The #! line is always examined for switches as the line is being parsed. Thus, if you're on a machine that allows only one argument with the #! line, or worse, doesn't even recognize the #! line, you still can get consistent switch behavior regardless of how Perl was invoked, even if -x was used to find the beginning of the script.
perl itself parses the #! line, even if the operating system ignores it. There are a few other tricks perl does with the #! line, also described in perlrun.

Replies are listed 'Best First'.
Re: Re: use warnings vs. perl -w
by idnopheq (Chaplain) on Apr 10, 2001 at 16:35 UTC
    You can also apply '-w' in the file association if you are concerned. Go to "Tools - Folder Options - File Types". Find your PL entry. Edit the Open property and add '-w' and whatever other options you want by default.

    Of course, you could also set this programatically via perl.

    As I recall, before the Grand Unification of AS and GS Win32 perl distributions, you had to add it for GS, though I could be mistaken.

    HTH
    Dex

      Has anyone ever tried using $^W. I never have but it from "perl -d -e 0" I've done this: print "$junk" --- No output $^W = 1 print "$junk" --- Use of uninitialized value in string at (eval 7)C:/Perl/lib/perl5db.pl:1521 line 2 -Jim

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://53994]
help
Chatterbox?
[Eily]: oh, boolean context uses the "" overload if no bool overload has been defined
[Eily]: (I wondered if overloading bool was actually necessary)
[Corion]: Yeah, you need bool to get a true value, and the rest to return the other value ;)
[choroba]: perl -wE '{package o; use Tie::Scalar; use parent -norequire => "Tie::StdScalar" ;sub FETCH { "x" x int rand 2}} tie my $x, "o" ; say $x for 1 .. 10'
[choroba]: for complete ness

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (9)
As of 2017-07-27 13:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (414 votes). Check out past polls.