cons-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Packages and cons


From: Wayne Scott
Subject: Re: Packages and cons
Date: Wed, 18 Jul 2001 08:56:45 -0500

Guys,

You can include a module into the toplevel Construct script and have
it available to all the subscripts.  You just need to select the
destination package explicitly.

For example my Construct file looks like this:
    
    BEGIN {
          package cons;
          use Mystuff;
    }
    $CONS = new cons;

    $CONS->printhi;   # call new method

Mystuff.pm looks like this:

     package Mystuff;

     require Exporter;
     @ISA = qw(Exporter);
     @EXPORT = qw(printhi);

     sub printhi
     {
         print "hello\n";
     }

     1;

-Wayne






reply via email to

[Prev in Thread] Current Thread [Next in Thread]