in reply to Re: Installing Sybase::DBlib problems
in thread Hello Word\n

the Clients that I deploy to don't even need the Sybase:DBlib!

Well, then don't load it in this case... :)   The if module might come in handy for that.  E.g.

sub SERVER() {1} # or: use constant SERVER => 1; use if SERVER, "Sybase:DBlib";

Replies are listed 'Best First'.
Re^3: Installing Sybase::DBlib problems
by wilko (Acolyte) on Nov 20, 2008 at 13:24 UTC
    yeah i tried the logical route but failed miserably. I still get the same error message...

    if($param eq "send"){ sendMounts() } elsif($param eq "recv") { use lib './lib'; use Sybase::DBlib; }
    So the senders don't even need the Sybase::DBlib but the script still dies on use Sybase::DBlib

      use is compile time. It gets executed regardless of the elsif clause. You could use require:

      elsif($param eq "recv") { use lib './lib'; require Sybase::DBlib; Sybase::DBlib->import; # if any imports }

      That's not the way to do it.  use statements are being executed at compile time, and the condition is being evaluated at runtime.

      That's what the if module is for... (or use require instead of use)

        Thanks almut and all Monks who offered their wisdom!

        I didn't know about the 'if' module

        use lib './lib'; use if $ARGV[0] eq "recv", Sybase::DBlib;
        Regards
        John