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

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

Replies are listed 'Best First'.
Re^6: Installing Sybase::DBlib problems
by almut (Canon) on Nov 20, 2008 at 14:01 UTC

    Just two more things to be aware of.  It's usually better to specify the module name as a string ("Sybase::DBlib")1, otherwise you'd get a "Bareword ... not allowed" error when running under "use strict".

    Second, the "use if ..." condition is tested at compile time. In this particular case with $ARGV[0] this is not a problem, because the variable is initialized early on. But if you use some other variable, you might need to wrap its assigment in a BEGIN {...} block...

    ___

    1 only with "use if", that is — with plain "use", in contrast, a bareword is needed.