|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
|
Re: require instead of use
|
> I'm using Net::FTP in a program, but I don't want to load it with use(),
> because I don't want it loaded on startup -- I want to load it
> conditionally, only if it's needed -- so that it'll run on machines
> without Net::FTP that don't need it.
>
> But when I load it with require(), I don't get the new() subroutine, which
> I need. I tried doing "import Net::FTP 'new'", but that.. didn't help.
>
> The program is http://chaosriegns.com/code/dlkern. I'm trying to replace
> line 306: use Net::FTP;
>
>
> Someone suggested I tell users to manually modify the code to suit their
> system. I don't like that answer.
Funny, I can still require it, how are you calling new?
require Net::FTP;
my $ftp = Net::FTP->new("ftp.cdrom.com");
print 'ftp: ',$ftp,"\n";
works fine on my laptop.
So the technique whehe you do the eval should work...
k
------------------------------------------------------------------------------
With a PC, I always felt limited by the software available. On Unix, I am
limited by my knowledge.
-- Peter J. Schoenster <pschon@baste.magibox.net>
mortis@voicenet.com http://www.voicenet.com/~mortis
------------------------------------------------------------------------------
**Majordomo list services provided by PANIX <URL:http://www.panix.com>**
**To Unsubscribe, send "unsubscribe phl" to majordomo@lists.pm.org**
|
|