in reply to The -w switch on a web application

I think it's a good idea to use defined ... however, if you got a new enough perl (and you should), look into the warnings pragma.
use warnings; no warnings 'uninitialized';
The other benefit of the "warnings" pragma is that its properly scoped, where as -w(aka $^W) is global, after all, you only wanna get warnings generated by your code, unless you plan submitting patches ;)


MJD says you can't just make shit up and expect the computer to know what you mean, retardo!
** The Third rule of perl club is a statement of fact: pod is sexy.

Replies are listed 'Best First'.
Re: Re: The -w switch on a web application
by zengargoyle (Deacon) on Jan 31, 2003 at 12:45 UTC

    and if you have older perl...

    #!/usr/bin/perl -w $SIG{__WARN__} = sub { local $_ = shift; print STDERR unless /Use of uninitialized value/; }; my $f; print "no warning here -->$f<--",$/; warn "woot! other warnings here...";