(Newbie) Use of uninitialized value in concatenation (.) or string

J

Jesse Cary

I am making a script that issues commands, pulls certain text from the
results and puts that text into an HTML table. I got the first two
columns to display fine and used my method as a template to fill the
third column, but I get the error stated in the subject line.
Below is the code and the text I am pulling the date from;

#CODE#
# STORE THE NAMES OF ALL THE VOBS #
@VOBS = `cleartool lsvob -s | sort`;
if ( $#VOBS == -1 )
{
printf ("INFO: No MultiSited VOBs - exiting\n");
exit 0;
}
###################################
# GET THE SPACE INFO FOR EACH VOB # this part is working fine...
###################################
foreach $VOB_NAME (@VOBS)
{
chomp ($VOB_NAME);
$VOB_SPACE{$VOB_NAME} = `cleartool space \ $VOB_NAME`;

# EXTRACT ONLY THE SPACE USED IN MB FROM THE SPACE COMMAND #
if ( $VOB_SPACE{$VOB_NAME} =~ /(\d+?\.\d)\s+?\d+?%\s+?Subtotal/ )
{
$VOB_SPACE{$VOB_NAME} = $1;
}
# IF NO INFO AVAILABLE FOR A VOB PRINT "N/A" FOR NOT AVAILABLE #
else {
$VOB_SPACE{$VOB_NAME} = "N/A";
}
}
#########################################
# GET THE DESCRIPTION INFO FOR EACH VOB #
#########################################
foreach $VOB_NAME (@VOBS)
{
#chomp ($VOB_NAME);
$VOB_DSCR{$VOB_NAME} = `cleartool describe -l vob:$VOB_NAME`;

# EXTRACTING CREATION DATE #
if ( $VOB_DSCR{$VOB_NAME} =~ /created\s(\d\d-\w{3}-\d\d)/ )
{
$VOB_DATE{$VOB_NAME} = $1;
}
}
##### THIS IS WHAT I'M PULLING THE DATE FROM #########
versioned object base "\VPPSHAREsrc"
created 16-Apr-03.14:16:58 by ustr-vp-bld.Domain Users@USTR-CMMGEN
master replica: CPG_COMMS@\VPPSHAREsrc
replica name: CPG_COMMS
VOB family feature level: 3
VOB storage host:pathname
"ustr-cpgcc:d:\ClearCase_Storage\VOBs\VPPSHAREsrc.vbs"
VOB storage global pathname
"\\ustr-cpgcc\ccstg_d\VOBs\VPPSHAREsrc.vbs"
database schema version: 54
VOB ownership:
owner NA\USTR-VP-bld
group NA\Domain Users
Attributes:
FeatureLevel = 3
Hyperlinks:
AdminVOB@40@\VPPSHAREsrc -> vob:\COMMS
###################### BACK TO THE CODE BELOW ##############

################# OPEN HTML FILE VDS.html ###################
open(HTMLDOC, ">VDS.html") or die "Can't open VDS.html";
select(HTMLDOC);

printf("<html><head><title>VOB Status Page</title></head><body> \n");
printf("<table border=\"1\" cellspacing=\"0\" cellpadding=\"5\"> \n");
printf("<tr><td><b>VOB
Name</b></td><td><b>MBytes</b></td><td><b>Date</b></td></tr> \n");

foreach $VOB_NAME (@VOBS)
{
chomp ($VOB_NAME);
printf("<tr><td>$VOB_NAME</td><td>$VOB_SPACE{$VOB_NAME}</td><td>$VOB_DATE{VOB_NAME}</td></tr>
\n");
}

printf("</table></body></html> \n");

close(HTMLDOC);
################## DONE WITH HTML PORTION #####################

print STDOUT "\n ALL DONE! VDS.html has been updated \n";
 
P

Paul Lalli

Jesse Cary said:
I am making a script that issues commands, pulls certain text from the
results and puts that text into an HTML table. I got the first two
columns to display fine and used my method as a template to fill the
third column, but I get the error stated in the subject line.

No you don't. The error you get from perl would include the file and
line number of the error. These are vital pieces of information.

###################################
# GET THE SPACE INFO FOR EACH VOB # this part is working fine...
###################################
If it's working fine, why are you showing it to us? Why take up space
with code not relevant to your problem? You should always post the
shortest complete program you can which demonstrates your issue.

foreach $VOB_NAME (@VOBS)
{
chomp ($VOB_NAME);
printf("<tr><td>$VOB_NAME</td><td>$VOB_SPACE{$VOB_NAME}</td><td>$VOB_DAT
E{VOB_NAME}</td></tr>

Call it a hunch, but I'd bet your problem has something to do with using
$VOB_NAME twice and the string VOB_NAME another time.

Paul Lalli.
 
J

Jürgen Exner

Jesse said:
I am making a script that issues commands, pulls certain text from the
results and puts that text into an HTML table. I got the first two
columns to display fine and used my method as a template to fill the
third column, but I get the error stated in the subject line.
Below is the code and the text I am pulling the date from;

#CODE#
[snipsnap]

You are missing

use strict;
use warnings;

Add those, clean up your code until you are strict and warning clean, and
chances are your problem will be gone.

If not then please repost your cleaned up and I'm sure someone will be able
to help you.

jue
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,828
Latest member
LauraCastr

Latest Threads

Top