I am working on a Perl script that is getting quite lengthy so I thought I
would put the sub routines, hashes, and arrays in a seperate script from
the main.
The program will run when I turn use strict off in the main script, but
when I turn it on the main script doesn't recognize the hash and
array delaration in the second script.
main script first few lines:
#!/usr/bin/perl
use warnings;
use strict;
use POSIX;
use FileHandle;
require "rt_evdo_pcmd_lib.pl";
#Market configurations has for cells
my %marketInfo = (
"xxx" => { "start" => 300,
"end" => 599, },
"yyy" => { "start" => 900,
"end" => 971, },
"zzz" => { "start" => 871,
"end" => 899, },
"aaa" => { "start" => 1,
"end" => 299, },
"hhh" => { "start" => 800,
"end" => 850, },
);
Script B with sub routines, hash and array declarations:
#!/usr/bin/perl
use warnings;
use strict;
my %fieldMap = (
"Version" => 0,
"SRT" => 11,
"SRFC" => 12,
"CFC" => 21,
"CFCQ" => 22,
"ICell" => 29,
"ISector" => 30,
"Cell" => 31,
"Sector" => 32,
);
my %fieldIndex = reverse(%fieldMap);
my @pegs =
("SesAtt","SesEst","FailXfer","Ses%","ConnAtt","ConnEst","Conn%","RfLost","CpDropCell","CpDropRnc","TuneAway",
"TDrops","DCR%","IA","IA%","Tccf","FailAp","FailTp","FailA10","FailAAA","FailPdsn");
The compilation errors i am getting are:
Global symbol "%fieldMap" requires explicit package name at ./
rt_evdo_pcmd.pl line 98.
Global symbol "%fieldMap" requires explicit package name at ./
rt_evdo_pcmd.pl line 99.
Global symbol "%fieldMap" requires explicit package name at ./
rt_evdo_pcmd.pl line 100.
(I am just showing the first 3 since they are all related to the hash
%fieldMap and array @pegs)