in reply to Re: Hello Word\n
in thread Hello Word\n

thanks to all for replies so far...
The problem with installing the module via CPAN is that it would need to be done on many servers which is not practical. I may need a re-think on how to deploy. It's a shame coz the Clients that I deploy to don't even need the Sybase:DBlib! Only the Server needs it (which already has it installed and working). Thing is, I want all my perl in 1 script which takes a parameter on the command line like Send or Recv depending on whether it's the client(sender) or server(recv)

Replies are listed 'Best First'.
Re^2: Installing Sybase::DBlib problems
by almut (Canon) on Nov 20, 2008 at 13:05 UTC
    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";
      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)

Re^2: Installing Sybase::DBlib problems
by moritz (Cardinal) on Nov 20, 2008 at 13:07 UTC
    Most unixish systems use some kind of package system for installing software (for example Debian uses .deb, RedHat uses .rpm etc.). Usually it's not that much effort to build such a package for your OS from a CPAN distribution, for example for Debian dh-make-perl really helps.

    Probably such an option is also available for your OS (whatever it is).

Re^2: Installing Sybase::DBlib problems
by JavaFan (Canon) on Nov 20, 2008 at 13:07 UTC
    The problem with installing the module via CPAN is that it would need to be done on many servers which is not practical.
    You need to compile the sources for each platform/perl version combination you have. How to do this best depends on the infrastructure you have. Go ask around, how do you normally deploy (compiled) software?