perl module & vars

Discussion in 'Perl' started by vertigo, Jul 6, 2004.

  1. vertigo

    vertigo Guest

    Hello
    Can i export from perl module value in variable ?
    For example:
    $default_path="/usr/bin/";
    How should i call this variable from other programs which
    use this module ?

    Thanx
    Michal
     
    vertigo, Jul 6, 2004
    #1
    1. Advertisements

  2. vertigo wrote:
    > Can i export from perl module value in variable ?
    > For example:
    > $default_path="/usr/bin/";
    > How should i call this variable from other programs which
    > use this module ?


    If the variable has been imported: As usual. Otherwise you need to
    qualify the name like:

    $packagename::default_path

    Why don't you read "perldoc perlmod", and try to create a simple
    module to get a grasp.

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
     
    Gunnar Hjalmarsson, Jul 6, 2004
    #2
    1. Advertisements

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. Jon

    app vars and cache vars

    Jon, Dec 14, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    658
  2. Kepes Krisztian

    How to access my module global vars ?

    Kepes Krisztian, Nov 25, 2003, in forum: Python
    Replies:
    0
    Views:
    333
    Kepes Krisztian
    Nov 25, 2003
  3. Martin Drautzburg

    accessing module global vars by name

    Martin Drautzburg, Dec 20, 2004, in forum: Python
    Replies:
    2
    Views:
    363
    Peter Hansen
    Dec 20, 2004
  4. Marco Aschwanden

    Using "external" vars on module load time

    Marco Aschwanden, Jun 14, 2006, in forum: Python
    Replies:
    3
    Views:
    472
    Diez B. Roggisch
    Jun 14, 2006
  5. Replies:
    1
    Views:
    425
    Diez B. Roggisch
    Oct 29, 2006
  6. Linuxguy123
    Replies:
    7
    Views:
    940
    Paddy O'Loughlin
    Feb 20, 2009
  7. caccolangrifata
    Replies:
    18
    Views:
    566
    Chris Torek
    Jul 22, 2011
  8. Owen_Townsend
    Replies:
    5
    Views:
    289
    Stephan Titard
    Jul 10, 2006
Loading...