How to use different PM in different cases.

Discussion in 'Perl Misc' started by Franklin Lee, Feb 23, 2004.

  1. Franklin Lee

    Franklin Lee Guest

    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
    Franklin Lee, Feb 23, 2004
    #1
    1. Advertising

  2. 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
    Gunnar Hjalmarsson, Feb 23, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Patrick.O.Ige
    Replies:
    1
    Views:
    435
  2. Uncle Bob (Robert C. Martin)

    Use Cases -- A minimalist's View

    Uncle Bob (Robert C. Martin), Jul 2, 2003, in forum: Java
    Replies:
    0
    Views:
    751
    Uncle Bob (Robert C. Martin)
    Jul 2, 2003
  3. Alan Cyment
    Replies:
    1
    Views:
    1,352
    Esmond Pitt
    Jan 29, 2004
  4. Andreas Pauley

    Point of Sale Use Cases

    Andreas Pauley, May 26, 2005, in forum: Python
    Replies:
    0
    Views:
    418
    Andreas Pauley
    May 26, 2005
  5. Jp Calderone

    Re: Use cases for del

    Jp Calderone, Jul 6, 2005, in forum: Python
    Replies:
    35
    Views:
    842
    Terry Reedy
    Jul 10, 2005
Loading...

Share This Page