G
g3000
Hello,
I have the following code:
use strict;
use warnings;
use Cwd;
use Math::Random;
our $curr = 'C:\\BackupSamsDB\export\samsdb9877333771';
our $configtime = localtime();
our $ORAHOME = 'C:\oracle\ora81\bin';
our $ORASID = 'SAMSDB';
our $dblocation = 'c:\oracle\oradata\samsdb';
our $backupid = 'samsdb9877333771';
our $lstBackupLoc;
sub getRepository()
{
my $display = shift || 1;
if ( -e 'backupRepository.conf' and $display )
{
open (CONFREP, "< backupRepository.conf");
undef $/;
eval <CONFREP>;
close CONFREP;
for my $bkpID ( keys %rep )
{
print "This is the time: $rep{$bkpID}->{TIMESTAMP}";
$lstBackupLoc = $rep{$bkpID}->{BACKUP_LOCATION};
$ORAHOME = $rep{$bkpID}->{ORAHOME};
$ORASID = $rep{$bkpID}->{ORASID};
$dblocation = $rep{$bkpID}->{DBFILES};
}
} #END IF
else
{
writeToRepository();
}#end else
}#end getRepository
sub writeToRepository()
{
use Data:
umper;
$Data:
umper:
urity = 1;
if (!(-e 'backupRepository.conf'))
{
my %rep = ($backupid => {
TIMESTAMP => $configtime,
SERVER => "bc12025",
BACKUP_LOCATION => $curr,
ORAHOME => $ORAHOME,
ORASID => $ORASID,
DBFILES => $dblocation
}
);
open (CONFREP, "> backupRepository.conf");
print CONFREP Data:
umper->Dump([\%rep], ['*rep']);
close CONFREP;
}#end if
else
{
my $bid = 'samsdb9432164421';
open (CONFREP, "< backupRepository.conf");
undef $/;
eval <CONFREP>;
close CONFREP;
$rep{$bid} = {TIMESTAMP => $configtime,
SERVER => "SAMSDEV",
BACKUP_LOCATION => $curr,
ORAHOME => $ORAHOME,
ORASID => $ORASID,
DBFILES => $dblocation
};
open (CONFREP, "> backupRepository.conf");
print CONFREP Data:
umper->Dump([\%rep], ['*rep']);
close CONFREP;
}#end if
}#END writeToRepository
getRepository();
which gives me the following:
Global symbol "%rep" requires explicit package name at c:\wip\pdb.pl
line 20.
Global symbol "%rep" requires explicit package name at c:\wip\pdb.pl
line 22.
Global symbol "$lstBackupLoc" requires explicit package name at
c:\wip\pdb.pl line 24.
Global symbol "%rep" requires explicit package name at c:\wip\pdb.pl
line 24.
Global symbol "$bkpID" requires explicit package name at c:\wip\pdb.pl
line 24.
Global symbol "%rep" requires explicit package name at c:\wip\pdb.pl
line 25.
Global symbol "$bkpID" requires explicit package name at c:\wip\pdb.pl
line 25.
Global symbol "%rep" requires explicit package name at c:\wip\pdb.pl
line 26.
Global symbol "$bkpID" requires explicit package name at c:\wip\pdb.pl
line 26.
Global symbol "%rep" requires explicit package name at c:\wip\pdb.pl
line 27.
Global symbol "$bkpID" requires explicit package name at c:\wip\pdb.pl
line 27.
BEGIN not safe after errors--compilation aborted at c:\wip\pdb.pl line
36.
why is it when I comment out use strict I dont get the above errors?
If it is in a doc somewhere can u post the link so I can read for
myself?
Thank you.
I have the following code:
use strict;
use warnings;
use Cwd;
use Math::Random;
our $curr = 'C:\\BackupSamsDB\export\samsdb9877333771';
our $configtime = localtime();
our $ORAHOME = 'C:\oracle\ora81\bin';
our $ORASID = 'SAMSDB';
our $dblocation = 'c:\oracle\oradata\samsdb';
our $backupid = 'samsdb9877333771';
our $lstBackupLoc;
sub getRepository()
{
my $display = shift || 1;
if ( -e 'backupRepository.conf' and $display )
{
open (CONFREP, "< backupRepository.conf");
undef $/;
eval <CONFREP>;
close CONFREP;
for my $bkpID ( keys %rep )
{
print "This is the time: $rep{$bkpID}->{TIMESTAMP}";
$lstBackupLoc = $rep{$bkpID}->{BACKUP_LOCATION};
$ORAHOME = $rep{$bkpID}->{ORAHOME};
$ORASID = $rep{$bkpID}->{ORASID};
$dblocation = $rep{$bkpID}->{DBFILES};
}
} #END IF
else
{
writeToRepository();
}#end else
}#end getRepository
sub writeToRepository()
{
use Data:
$Data:
if (!(-e 'backupRepository.conf'))
{
my %rep = ($backupid => {
TIMESTAMP => $configtime,
SERVER => "bc12025",
BACKUP_LOCATION => $curr,
ORAHOME => $ORAHOME,
ORASID => $ORASID,
DBFILES => $dblocation
}
);
open (CONFREP, "> backupRepository.conf");
print CONFREP Data:
close CONFREP;
}#end if
else
{
my $bid = 'samsdb9432164421';
open (CONFREP, "< backupRepository.conf");
undef $/;
eval <CONFREP>;
close CONFREP;
$rep{$bid} = {TIMESTAMP => $configtime,
SERVER => "SAMSDEV",
BACKUP_LOCATION => $curr,
ORAHOME => $ORAHOME,
ORASID => $ORASID,
DBFILES => $dblocation
};
open (CONFREP, "> backupRepository.conf");
print CONFREP Data:
close CONFREP;
}#end if
}#END writeToRepository
getRepository();
which gives me the following:
Global symbol "%rep" requires explicit package name at c:\wip\pdb.pl
line 20.
Global symbol "%rep" requires explicit package name at c:\wip\pdb.pl
line 22.
Global symbol "$lstBackupLoc" requires explicit package name at
c:\wip\pdb.pl line 24.
Global symbol "%rep" requires explicit package name at c:\wip\pdb.pl
line 24.
Global symbol "$bkpID" requires explicit package name at c:\wip\pdb.pl
line 24.
Global symbol "%rep" requires explicit package name at c:\wip\pdb.pl
line 25.
Global symbol "$bkpID" requires explicit package name at c:\wip\pdb.pl
line 25.
Global symbol "%rep" requires explicit package name at c:\wip\pdb.pl
line 26.
Global symbol "$bkpID" requires explicit package name at c:\wip\pdb.pl
line 26.
Global symbol "%rep" requires explicit package name at c:\wip\pdb.pl
line 27.
Global symbol "$bkpID" requires explicit package name at c:\wip\pdb.pl
line 27.
BEGIN not safe after errors--compilation aborted at c:\wip\pdb.pl line
36.
why is it when I comment out use strict I dont get the above errors?
If it is in a doc somewhere can u post the link so I can read for
myself?
Thank you.