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

Discussion in 'Perl Misc' started by Jesse Cary, Oct 15, 2004.

  1. Jesse Cary

    Jesse Cary Guest

    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";
    Jesse Cary, Oct 15, 2004
    #1
    1. Advertising

  2. Jesse Cary

    Paul Lalli Guest

    "Jesse Cary" <> wrote in message
    news:...
    > 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.
    Paul Lalli, Oct 15, 2004
    #2
    1. Advertising

  3. 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
    Jürgen Exner, Oct 15, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. G Kannan
    Replies:
    1
    Views:
    1,222
    Eric J. Roode
    Oct 11, 2003
  2. Sukhbir Dhillon
    Replies:
    1
    Views:
    6,231
    Joe Smith
    Apr 5, 2004
  3. smartins68
    Replies:
    1
    Views:
    5,984
    Joe Smith
    Jun 9, 2004
  4. S
    Replies:
    3
    Views:
    319
    Gunnar Hjalmarsson
    Feb 3, 2004
  5. Amaninder
    Replies:
    6
    Views:
    212
    J. Gleixner
    Jul 18, 2006
Loading...

Share This Page