Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > How to use different PM in different cases.

Reply
Thread Tools

How to use different PM in different cases.

 
 
Franklin Lee
Guest
Posts: n/a
 
      02-23-2004
Hi ALl,

I have two different libs:
/opt/myapp/lib1/utils.pm
/opt/myapp/lib2/utils.pm

In the main program, I will get parameter, for example, $lib.

If $lib eq lib1, then I want to use /opt/myapp/lib1/utils.pm

If $lib eq lib2, then I want to use /opt/myapp/lib2/utils.pm

How can I design my program?

Thank you!

Franklin


 
Reply With Quote
 
 
 
 
Gunnar Hjalmarsson
Guest
Posts: n/a
 
      02-23-2004
Franklin Lee wrote:
> I have two different libs:
> /opt/myapp/lib1/utils.pm
> /opt/myapp/lib2/utils.pm
>
> In the main program, I will get parameter, for example, $lib.
>
> If $lib eq lib1, then I want to use /opt/myapp/lib1/utils.pm
>
> If $lib eq lib2, then I want to use /opt/myapp/lib2/utils.pm
>
> How can I design my program?


require "/opt/myapp/$lib/utils.pm";

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
How to use different asmx in different sub-directories ? Sophie PARISOT ASP .Net Web Services 1 02-13-2006 03:52 AM
use warnings; and use Warnings; give different results Ted Sung Perl Misc 1 08-30-2004 10:22 PM
Different responses from different systems Tigerhillside Perl 3 02-23-2004 01:56 AM
Bind different rows to different data sources in data grid AD ASP .Net 1 08-23-2003 10:34 PM



Advertisments