CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Conflicting Functions?

 



sh3llburn
Novice

Aug 24, 2000, 10:50 AM

Post #1 of 3 (455 views)
Conflicting Functions? Can't Post

Hello All,
I will be writing a script that will have to use these funcions:

use Net::FTP
use GetOpt::Long
use English
use strict

can anyone forsee any conflicts using these four functions together?? Any advice would be appreciated. Thanks, in advance.


------------------
"I know what you're thinking... did he fire 5 shots or 6? ..."


fashimpaur
User / Moderator

Aug 31, 2000, 10:54 PM

Post #2 of 3 (455 views)
Re: Conflicting Functions? [In reply to] Can't Post

Hard to tell. First off, those are not functions but you are telling the perl compiler that you wish to use those libraries/objects.

Second, any conflicts can be resolved for sure by explicitly telling the compiler that you do not want to import any of those module's exported methods and tags by default.

To do this, simply change the way you instantiate the need for the module's.
i.e.:

use Net::FTP();
use English();
use GetOpt::Long();
use strict; # no need to worry about this one because it does not export anything for sure.

Okay, if you need to use some of a modules imported functions, you can do the following:

use ModuleName qw( method1 method2 );

This says that you only wish to permit the import of ModuleName::method1 and ModuleName::method2.

Remember, if you do not import a method that
is required, you cannot use it. So, be careful. Most of the POD documentation should specify proper technique to call a method from a given module.

i.e.:

use Net::FTP;
$ftp = new Net::FTP('domain.com');
$ftp->helo;
...
etc.

Good luck.

HTH,

Dennis


sh3llburn
Novice

Sep 1, 2000, 12:49 PM

Post #3 of 3 (455 views)
Re: Conflicting Functions? [In reply to] Can't Post

You're right, they're 'modules'...
Actually, the list has changed a little. It is as follows:

use Net::FTP;
use Net::Telnet;
use English;
use Getopt::Long;
use File::Listing qw(parse_dir);
use strict;


So, I thank you taking the time to reply. Have a great weekend.

------------------
"I know what you're thinking... did he fire 5 shots or 6? ..."

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives