pinkeshprajapati has asked for the wisdom of the Perl Monks concerning the following question:
hi
is their any way by which we can link/access the variable value of other modules without defining it as global variables in it...??
Thanks in advance... :-)
use below code for reference... Note i want to access this variable without defining this variable as global in xyz.pm module.... Can anyone Please suggest way to do this.. ??
abc.pl use strict; use warning; use xyz; print @array;
xyz.pm package xyz; use strict; use warnings; require 5.008; require Exporter; our @ISA = qw(Exporter); our @EXPORT = qw( @array ); my $file = "qwerty.txt"; open FILE, "< $file"; my @array = <FILE>;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How we can link/access the variables of different module in main script without defining variable as global.. ??
by davido (Cardinal) on Feb 27, 2014 at 06:38 UTC | |
|
Re: How we can link/access the variables of different module in main script without defining variable as global.. ??
by NetWallah (Canon) on Feb 27, 2014 at 06:30 UTC | |
|
Re: How we can link/access the variables of different module in main script without defining variable as global.. ??
by AnomalousMonk (Archbishop) on Feb 27, 2014 at 12:07 UTC | |
|
Re: How we can link/access the variables of different module in main script without defining variable as global.. ??
by Arunbear (Prior) on Feb 27, 2014 at 11:38 UTC | |
|
Re: How we can link/access the variables of different module in main script without defining variable as global.. ??
by vinoth.ree (Monsignor) on Feb 27, 2014 at 06:32 UTC |