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

[MacPerl] importing variables between modules with "strict"



Hi

I have some problem using "strict" to import all my variables between two
modules.

in module "functions.pm" :

-------------------------
#!perl

package functions2;
use strict;
use vars qw (@ISA @EXPORT @EXPORT_OK);

use Exporter;
my @ISA = qw(Exporter);

@EXPORT = qw($alpha);

my $alpha = "qwerty";
-------------------------

and in script : "script.pm" :

-------------------------
#!perl

use strict;
use functions2 qw ($alpha);

my $alpha;
print "alpha : $functions2::alpha\n";     # WRONG : prints "alpha"
print "alpha : $alpha\n";  # WRONG : prints "alpha"
---------------------------


Any help ?

Thanks
Jean-François



I'm sorry, there is no "list@macperl.org". Did you mean
macperl@macperl.org? Or one of the other lists?

Please resend your message to the appropriate list.

Remember, you must be subscribed to post to a list.

- Vicki

>  --- Begin Forward ---
>
>  X-Sent-To: <list@macperl.org>
>  Date: Sat, 13 Nov 1999 11:36:39 -0500
>  From: Jean-François Jobidon <jfjobidon@netc.net>
>  Reply-To: jfjobidon@netc.net
>  Organization: Net Communications
>  X-Accept-Language: en
>  To: list@macperl.org
>  Subject: importing variables between modules with "strict"
>
>  Hi
>
>  I have some problem using "strict" to import all my variables between
>  two modules.
>
>  in module "functions.pm" :
>
>  -------------------------
>  $user = "someone";
>  -------------------------
>
>  in my script : "myscript.pm" :
>
>  -------------------------
>  use strict;
>
>  my $user;
>  print "user : $user";
>  ---------------------------
>
>  I think I have to import (or export ?) my functions and variables.
>  But I don't know how.
>
>  Any help ?
>
>  Thanks
>  Jean-François
>
>  --- End Forward ---
-- Vicki Brown <vlb@cfcl.com>      ZZZZzzz |\      _,,,---,,_
http://www.cfcl.com/~vlb                   /,`.-'`'    -.  ;-;;,_
Journeyman Sourceror: Scripts & Philtres  |,4-  ) )-,_. ,\ (  `'-'
P.O. Box 1269  San Bruno  CA  94066      '---''(_/--'  `-'\_)