Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Re: Migrating scripts back to Perl 5.005_03

by ajdelore (Pilgrim)
on Sep 05, 2003 at 22:50 UTC ( [id://289381]=note: print w/replies, xml ) Need Help??


in reply to Re: Migrating scripts back to Perl 5.005_03
in thread Migrating scripts back to Perl 5.005_03

If I understand perllexwarn, which I am not sure that I do, -w does set $^W globally. (And -W makes it irrevocable). Of course, you can't use the shebang in a module.

While in 5.6+ you could put use warnings; in a module and have it scoped to that file only, I think that setting $^W would be global unless enclosed in a block, or unless it was somehow contained.

package foo; use strict; $^W = 1; print "Testing\n", undef; 1; __END__ use strict; use foo; print "Testing\n", undef;

In the above example, both print statements throw a warning. However, if I do:

local $^W = 1;

Then I only get one in the module. Of course, the main thing that perllexwarn seems to say is "don't do any of this stuff." It seems better to take warnings as an all-or-nothing deal in 5.005.

</ajdelore>

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (2)
As of 2024-04-26 00:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found