J
Jon
I am running into a problem with the following snippet of code:
my $job = "";
my $db = "";
my @events;
my @pieces;
my $start;
my $running;
my %hash;
my $event;
my @input = `autorep -J PVS%R -d`;
foreach (@input) {
if(/(PV.*)\_([A-Z]?[A-Z0-9])/) {
if($1 ne $job || $2 ne $db) {
undef @events;
}
$job = $1;
$db = $2;
}
When the script first runs, I get the "Use of uninitialized value in
string eq" at the line with the regex. I do know that initially, the
input does not match. However, after the first iteration through the
foreach loop, I get no other warnings even if the input doesn't match.
Can anyone tell me what is uninitialized? Thanks.
my $job = "";
my $db = "";
my @events;
my @pieces;
my $start;
my $running;
my %hash;
my $event;
my @input = `autorep -J PVS%R -d`;
foreach (@input) {
if(/(PV.*)\_([A-Z]?[A-Z0-9])/) {
if($1 ne $job || $2 ne $db) {
undef @events;
}
$job = $1;
$db = $2;
}
When the script first runs, I get the "Use of uninitialized value in
string eq" at the line with the regex. I do know that initially, the
input does not match. However, after the first iteration through the
foreach loop, I get no other warnings even if the input doesn't match.
Can anyone tell me what is uninitialized? Thanks.