in reply to Can't call method "url" on an undefined value? But it appears defined!

Further to Corion's reply above:

The following code ... is unlikely to do what you intend it to do.

Likewise the statement
    die "No CGI query passed to SBL_Config::check" if undef $q;
which dies if the undefined value returned by undef after undefining  $q is true (it never will be). (Update: Furthermore,  $q is always undef-ed in this statement, thus rendering it useless — and then you try to use it!)

Maybe you mean
    die ... unless defined $q;
or
    die ... if ! defined $q;

Replies are listed 'Best First'.
Re^2: Can't call method "url" on an undefined value? But it appears defined!
by mjfrazer (Initiate) on Jan 26, 2014 at 01:59 UTC
    Thanks for taking the time to reply. Much appreciated.