>>>>> On Fri, 18 Jun 2010 11:23:38 +0200, Magnus Fromreide
>>>>> <[email protected]> said:
MF> So, I am looking for a way to say "import the module foo at path
MF> /path/to/foo.pm and if that fails then do this other thing" and my
MF> question to you perl experts is if that is possible.
I think the right thing to do is use a path to force require from a
particular place:
my $havedoneit = eval "require '../path/to/foo.pm'";
if (!$ havedoneit) {
# do something else
}
Or real command line testing:
# mkdir a
# mkdir b
# echo 'print "foo\n";' > a/c.pm
# echo 'print "bar\n";' > b/c.pm
# perl -Ib -e 'require c';
bar
# perl -Ib -e 'require "a/c.pm"' ;
foo
--
Wes Hardaker
Please mail all replies to [email protected]
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders