in reply to Re^4: Why am I getting "premature end of script header"?
in thread Why am I getting "premature end of script header"?
If you want to keep a variable to track whether the module is loaded you should use our, as you should always use strict (and warnings).
use strict; use warnings; our $lwpavailable = 0; BEGIN { eval (" use LWP::UserAgent; use HTTP::Request::Common; "); if ($@) { $lwpavailable = 0; } else { $lwpavailable = 1; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Why am I getting "premature end of script header"?
by lokiloki (Beadle) on Nov 27, 2006 at 23:16 UTC | |
by lokiloki (Beadle) on Nov 27, 2006 at 23:17 UTC | |
by imp (Priest) on Nov 27, 2006 at 23:20 UTC | |
by lokiloki (Beadle) on Nov 27, 2006 at 23:22 UTC |