Global symbol "%Properties" requires explicit package name



Hi,

I have declared my %Properties but I get the following when I execute:

Global symbol "%Properties" requires explicit package name at test.pl
line 62.
Global symbol "%Properties" requires explicit package name at test.pl
line 67.
Global symbol "%Properties" requires explicit package name at test.pl
line 69.
Global symbol "%Properties" requires explicit package name at test.pl
line 71.
Global symbol "%Properties" requires explicit package name at test.pl
line 72.
Global symbol "%Properties" requires explicit package name at test.pl
line 73.

I have noted the lines in the code below.

Do I have to make some declaration within the sub?

cheers,

//mike


***********************************************************************************************
use strict;
use warnings;

my $verbose = 0;
my $info = "[INFO] :";
my $error = "[ERROR]:";

my $configFile;
####################### Subroutines #######################

sub useage (){
print "Useage: perl rdeploy [ -file <config.dat path> ]\n";
exit 1;

}

sub readConfig {

print "Reading configuration data ...\n";
open FILE, "$configFile" or die "$error Could not open file
$configFile:$! ";
my %props = ();
while (<FILE>) {

s/\s+$//;# Remove all \r, \n, ^M from end of line
next if (/^$/);# ignore null lines
next if (/^\s*#/); # ignore comment line.
my ($config_name,$config_val)=split(/\s*=\s*/, $_,2);# Split the
line
$props{$config_name}=$config_val;
$verbose && print "$config_name\n";
}

close FILE;
return %props;

}


sub deploy {

my ($domain,$ear,$port) = @_;
#exit 1;

print "Make sure sailfin is started ...\n";

62: my @startargs = ($Properties{asadminexecutable},
'start-domain',
$domain);
system(@startargs) == 0 or die "system @startargs failed: $?";

67:print "Deploying $ear on $domain on HOST: $Properties{host} ....
\n";

69:my @deployargs = ($Properties{asadminexecutable},
'deploy',
71: "--user=$Properties{user}",
72: "--passwordfile=$Properties{passwordfile}",
73: "--host=$Properties{host}",
"--port=$port",
"$ear");

system(@deployargs) == 0 or die "system @deployargs failed: $?";
if ($? == -1) {
print "failed to execute: $!\n";
}
elsif ($? & 127) {
printf "child died with signal %d, %s coredump\n",
($? & 127), ($? & 128) ? 'with' : 'without';
}
else {
printf "child exited with value %d\n", $? >> 8;
}

}



#################################### Start Main
#######################################

# Checking arguments #

my $arg = @ARGV;
if ($arg > 0){
if($ARGV[0] =~ /-file/i){
$configFile=$ARGV[1];
}else{
&useage();
}
}else{
print "Using default config.dat in current in same directory as this
script!\n";
$configFile="config.dat";
}

my %Properties = &readConfig();


#Check that password file exists
print "Checking for passwordfile ...\n";
my $file = $Properties{passwordfile};
if(! -f $file ){
print "$error password file, $file, does not exist!";
exit 1;
}

#Deploy on both domains
deploy($Properties{domain1},$Properties{port1},
$Properties{frontenddeployunit});
deploy($Properties{domain2},$Properties{port2},
$Properties{backenddeployunit});
.



Relevant Pages

  • Re: Can anyone program perl and fix a script?
    ... (Missing operator before packets?) ... Global symbol "$tmp" requires explicit package name at ./natview line 14. ...
    (alt.os.linux)
  • Use Strict Question
    ... Global symbol "$OrderFile" requires explicit package name at theta.pl ... Global symbol "$referer" requires explicit package name at theta.pl ... Global symbol "@odate" requires explicit package name at theta.pl line ...
    (perl.beginners)
  • Re: First Perl/CGI need critique on current code before further developement
    ... The errors in this script are _pervasive_. ... with future reserved word at webcounter.pl line 12. ... Global symbol "$slash" requires explicit package name at webcounter.pl line ...
    (comp.lang.perl.misc)
  • Re: Modify program to write just data to a text file.
    ... Global symbol "%DB" requires explicit package name at t.pl line 46. ... Bareword "BorOblig" not allowed while "strict subs" in use at t.pl line 26. ...
    (comp.lang.perl.misc)
  • Re: Lost here.. Use of uninitialized value in print?
    ... Global symbol "@files1to5" requires explicit package name at D:\My ... Global symbol "$list1" requires explicit package name at D:\My ... Global symbol "$selectitem" requires explicit package name at D:\My ...
    (perl.beginners)