in reply to Making -w happy
$::test_host is a variable that will be skipped by the strict checks, because it is fully qualified. Such a variable would have to be either defined via use vars qw( $test_host ); or on the command line via -Dtest_host=foo - the more likely case. Then, warnings would warn that $::test_host was only used once in the program source, and the double test tricks warnings there.
In my opinion, it would be be better to locally disable that warning than to test $test_host twice, as it is not really obvious ...
my $host; { no warnings 'once'; $host = shift @ARGV ||$ENV{'DBI_HOST'} || $::test_host; };
Update: s!strict!warnings!g
perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Making -w happy
by chantstophacking (Acolyte) on Mar 03, 2003 at 16:47 UTC |