mathew_p_a has asked for the wisdom of the Perl Monks concerning the following question:
b.pl {print v1 v2 ==>this should be printing the updated v1 v2}a.pl {v1 = "New file" v2 = "New id" }
Package method I tried. Eventhough I can access the declared value, its not allowing me to change the value globally. Is there any way to solve this in a clean way.
#!/usr/bin/perl package vardeclare; use strict;use warnings; use Exporter; our @ISA = 'Exporter'; our @EXPORT = qw($MASTERLOGFILE); our ($MASTERLOGFILE, $MASTERID); $MASTERLOGFILE="LOGFILE not defined"; $MASTERID="0000000";
Came to know that it can be done using classes, but is there a plain way to do it Any suggestions ???
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Need to share and modify global variables across modules and packages.
by Anonymous Monk on Jun 21, 2013 at 07:53 UTC | |
|
Re: Need to share and modify global variables across modules and packages.
by Preceptor (Deacon) on Jun 21, 2013 at 21:12 UTC | |
by mathew_p_a (Initiate) on Jun 26, 2013 at 10:19 UTC | |
by Preceptor (Deacon) on Jul 01, 2013 at 20:29 UTC |