Hello.
I have a script which logs into a PIX to check the number of connections and memory and then strips out what I don't need. But recently I have been having problems with the following error:
Use of uninitialized value in pattern match (m//) at fw.pl line 84, <STDIN> line 5.
Use of uninitialized value in pattern match (m//) at fw.pl line 91, <STDIN> line 5.
Here is the code I am using to get what I need from the PIX:
&process_input;
sub process_input
{
#
# Code to process the information from the PIX FireWall.
#
# Test output2
# Declaring variables and setting them to zero.
$in_use = 0;
$conn = 0;
$mem = 0;
#
# Processing now.
#
if ($output2[0] =~ /^\s*(\d+)\s+in use/) {
$in_use = $1;
}
# setting conn to special variable $1
$conn = $1;
$in_use = 0;
if ($output1[0] =~ /(\d+)\s+bytes free\s*$/) {
$in_use = $1;
}
}
Now my question is this:
Is there a way I can make sure the input I am getting is correct? The above code gets a series of numbers which I then manipulate into a simple to read format. Am I making enough sense in what I am asking?
Hal.
I have a script which logs into a PIX to check the number of connections and memory and then strips out what I don't need. But recently I have been having problems with the following error:
Use of uninitialized value in pattern match (m//) at fw.pl line 84, <STDIN> line 5.
Use of uninitialized value in pattern match (m//) at fw.pl line 91, <STDIN> line 5.
Here is the code I am using to get what I need from the PIX:
&process_input;
sub process_input
{
#
# Code to process the information from the PIX FireWall.
#
# Test output2
# Declaring variables and setting them to zero.
$in_use = 0;
$conn = 0;
$mem = 0;
#
# Processing now.
#
if ($output2[0] =~ /^\s*(\d+)\s+in use/) {
$in_use = $1;
}
# setting conn to special variable $1
$conn = $1;
$in_use = 0;
if ($output1[0] =~ /(\d+)\s+bytes free\s*$/) {
$in_use = $1;
}
}
Now my question is this:
Is there a way I can make sure the input I am getting is correct? The above code gets a series of numbers which I then manipulate into a simple to read format. Am I making enough sense in what I am asking?
Hal.