Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > (Newbie) Use of uninitialized value in concatenation (.) or string

Reply
Thread Tools

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

 
 
Jesse Cary
Guest
Posts: n/a
 
      10-15-2004
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 hostathname
"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";
 
Reply With Quote
 
 
 
 
Paul Lalli
Guest
Posts: n/a
 
      10-15-2004
"Jesse Cary" <> wrote in message
news: om...
> 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.

<snip>
> ###################################
> # 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.

<snip a bunch of intermingled data and code>

> 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.


 
Reply With Quote
 
 
 
 
Jürgen Exner
Guest
Posts: n/a
 
      10-15-2004
Jesse Cary wrote:
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Use of uninitialized value in concatenation (.) or string Amaninder Perl Misc 6 07-18-2006 05:28 PM
Use of uninitialized value in concatenation smartins68 Perl 1 06-09-2004 05:46 AM
Re: Use of uninitialized value in concatenation (.) or string Error Sukhbir Dhillon Perl 1 04-05-2004 02:31 AM
Use of uninitialized value in concatenation (.) or string S Perl Misc 3 02-03-2004 09:54 PM
Use of uninitialized value in concatenation (.) at register.pl line 38, <STDIN> line 10. G Kannan Perl 1 10-11-2003 11:58 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57