Professional Web Applications Themes

finding out what is uninitialized - PERL Beginners

I have two arrays that I am printing to a file and I get the "Use of uninitialized value..." warning. But I get that for less than 100 of 3000+ lines. Is there a way that I can log what data is uninitialized. Here's the snippet of code I am using: foreach $coded (fund_array) { printf (FILE "$coded\n"); } where the fund_array is defined by : push(fund_array,"$cat_key\|$title\|$url\|$code\|" ); I can't for the life of my figure out why I am getting this error for only a handful. TIA, Tim -- Tim McGeary Senior Library Systems Specialist Lehigh University 610-758-4998 edu...

  1. #1

    Default finding out what is uninitialized

    I have two arrays that I am printing to a file and I get the "Use of
    uninitialized value..." warning. But I get that for less than 100 of
    3000+ lines. Is there a way that I can log what data is uninitialized.
    Here's the snippet of code I am using:

    foreach $coded (fund_array) {
    printf (FILE "$coded\n");
    }

    where the fund_array is defined by :
    push(fund_array,"$cat_key\|$title\|$url\|$code\|" );

    I can't for the life of my figure out why I am getting this error for
    only a handful.

    TIA,
    Tim

    --
    Tim McGeary
    Senior Library Systems Specialist
    Lehigh University
    610-758-4998
    edu


    Tim Guest

  2. #2

    Default Re: finding out what is uninitialized

    Here is what I do for uninitialized variables:

    foreach $coded (fund_array) {
    if (defined($coded) {
    printf (FILE "$coded\n");
    }else{
    printf(FILE,"\n");
    }

    }

    or drop off the else statement if you don't want the blank line.

    Rod,



    On Aug 3, 2004, at 8:48 AM, Tim McGeary wrote:
     
    http://www.iowatelecom.net/~rodj/key.txt

    Script Guest

  3. #3

    Default Re: finding out what is uninitialized

    So if I don't have this, what is printed to my file? Nothing? Just an
    error to the screen?

    What I don't understand is that if the data wasn't there, I wouldn't
    have pushed it to the array previously. And I've gone over that code in
    depth and everything is being set before it's push together into the
    array. This really bugs me. (no pun intended)

    Tim

    Tim McGeary
    Senior Library Systems Specialist
    Lehigh University
    610-758-4998
    edu



    Script Monkey wrote: 
    > http://www.iowatelecom.net/~rodj/key.txt
    >[/ref]

    Tim Guest

  4. #4

    Default Re: finding out what is uninitialized

    Tim McGeary wrote: 

    Why are you using the printf() function? If you don't know, try
    print() instead.
     

    If that's the only way fund_array gets populated, there is no way it
    can contain undefined elements.

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
    Gunnar Guest

  5. #5

    Default Re: finding out what is uninitialized

    On Aug 3, 2004, at 9:12 AM, Gunnar Hjalmarsson wrote:
     
    >
    > If that's the only way fund_array gets populated, there is no way it
    > can contain undefined elements.[/ref]

    Is the warning pointing to the push() line though? One of those
    variables could be undef.

    James

    James Guest

  6. #6

    Default Re: finding out what is uninitialized

    Good point.

    Tim,

    how are $cat_key, $title, $url, and $code being populated?

    SM



    On Aug 3, 2004, at 9:14 AM, James Edward Gray II wrote:
     
    >>
    >> If that's the only way fund_array gets populated, there is no way it
    >> can contain undefined elements.[/ref]
    >
    > Is the warning pointing to the push() line though? One of those
    > variables could be undef.
    >
    > James
    >
    >
    > --
    > To unsubscribe, e-mail: org
    > For additional commands, e-mail: org
    > <http://learn.perl.org/> <http://learn.perl.org/first-response>
    >
    >
    >[/ref]
    http://www.iowatelecom.net/~rodj/key.txt

    Script Guest

  7. #7

    Default Re: finding out what is uninitialized

    Ok, here's the code that is pushing $cat_key, $title, $url, and $code
    into the fund_array:

    sirsi_array has a DB_key, a Title and "data" which is either a code or
    a URL, in such a manner:

    101|Journal of Nature|PBIO|
    101|Journal of Nature|http://www.nature.org/|
    102|Journal of Crap|PBIO|
    102|Journal of Crap|http://www.crap.org/|
    102|Journal of Crap|http://www.jstor.org/crap/|

    Each of the above rows is what the sirsi_array would have. Here's the
    pseudocode for the real code below:

    Split array element.
    Check to see if we have a new DB_key
    If yes, check to see if code matches allowed codes.
    If yes, then set $code=$data and $titles=1.
    Else, $titles=0, push to reject_array and move on.
    If no, set $title
    check for jstor or prola in $data
    If yes, append (archive) to $title
    set $url with $ezproxy prefix
    set $cat_key with simple algorithm based on # of titles
    push $cat_key, $title, $url, and $code to fund_array
    increment $titles

    Real code:

    my $preCat = 0;
    my $titles = 0;
    my $title = '';
    my $code = '';
    my $url = '';
    my fund_array;
    my reject_array;

    foreach $item (sirsi_array) {
    my ($temp_key, $temp_title, $data) = split (/\|/, $item);
    if ($preCat != $temp_key) { # new record
    $titles = 0;
    for (keys %codes_hash) {
    if ($data =~ /$_/) {
    $found = 1;
    last;
    }
    }
    if ($found) {
    $titles = 1;
    $code = $data;
    }
    else {
    $titles = 0;
    push(reject_array,"$temp_key\|$temp_title\|");
    next;
    }
    $preCat = $temp_key;
    $found = 0;
    }
    else {
    $title = $temp_title;
    if ($data =~ /jstor/) {
    $title = "$title(archive)";
    }
    elsif ($data =~ /prola/) {
    $title = "$title(archive)";
    }
    $url = "$ezproxy$data";
    $cat_key = $titles * $cat_value + $temp_key;
    push(fund_array,"$cat_key\|$title\|$url\|$code\|" );
    $titles = $titles + 1;
    }
    }

    Thanks,
    Tim


    Script Monkey wrote: 
    >>
    >>
    >> Is the warning pointing to the push() line though? One of those
    >> variables could be undef.
    >>
    >> James
    >>
    >>
    >> --
    >> To unsubscribe, e-mail: org
    >> For additional commands, e-mail: org
    >> <http://learn.perl.org/> <http://learn.perl.org/first-response>
    >>
    >>
    >>[/ref]
    > http://www.iowatelecom.net/~rodj/key.txt
    >
    >[/ref]

    Tim Guest

  8. #8

    Default Re: finding out what is uninitialized

    Tim McGeary wrote: 

    Before digging into it, and so we know which problem we are helping
    you to solve: *Is* the warning referring to the push() statement?

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
    Gunnar Guest

  9. #9

    Default Re: finding out what is uninitialized

    No, the warning statement is when I'm printing to the file. In both
    case, it refers to the process of writing to a file from the
    foreach $item (fund_array) process.

    Tim

    Tim McGeary
    Senior Library Systems Specialist
    Lehigh University
    610-758-4998
    edu



    Gunnar Hjalmarsson wrote: 
    >
    >
    > Before digging into it, and so we know which problem we are helping
    > you to solve: *Is* the warning referring to the push() statement?
    >[/ref]



    Tim Guest

  10. #10

    Default Re: finding out what is uninitialized

    [ Please type your replies below the quoted part of the message you
    respond to. Please only quote what's needed to give context. ]

    Tim McGeary wrote: 
    >
    > No, the warning statement is when I'm printing to the file. In
    > both case, it refers to the process of writing to a file from the
    > foreach $item (fund_array) process.[/ref]

    Well, in that case the reason for the warning is to be found anywhere
    else in your code.

    I would suggest that you write and post a *short* but *complete*
    program, including sample data, that people can copy and run, and that
    illustrates the problem you are encountering. When doing so, don't
    forget to enable strictures and declare *all* variables you are using.

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
    Gunnar Guest

  11. #11

    Default RE: finding out what is uninitialized

    From: Tim McGeary <mailto:EDU> wrote:

    : Ok, here's the code that is pushing $cat_key, $title,
    : $url, and $code into the fund_array:
    :
    : sirsi_array has a DB_key, a Title and "data" which
    : is either a code or a URL, in such a manner:
    :
    : 101|Journal of Nature|PBIO|
    : 101|Journal of Nature|http://www.nature.org/|
    : 102|Journal of Crap|PBIO|
    : 102|Journal of Crap|http://www.crap.org/|
    : 102|Journal of Crap|http://www.jstor.org/crap/|
    :
    : Each of the above rows is what the sirsi_array
    : would have. Here's the pseudocode for the real code
    : below:
    :
    : Split array element.
    : Check to see if we have a new DB_key
    : If yes, check to see if code matches allowed codes.
    : If yes, then set $code=$data and $titles=1.
    : Else, $titles=0, push to reject_array and move on.
    : If no, set $title
    : check for jstor or prola in $data
    : If yes, append (archive) to $title
    : set $url with $ezproxy prefix
    : set $cat_key with simple algorithm based on # of titles
    : push $cat_key, $title, $url, and $code to fund_array
    : increment $titles
    :
    : Real code:
    :
    : my $preCat = 0;
    : my $titles = 0;
    : my $title = '';
    : my $code = '';
    : my $url = '';
    : my fund_array;
    : my reject_array;


    You have 'strict' turned off. Not a good idea. You'll
    need to present a working example or more code (all of
    it?). I added this, but there is still more missing.

    my sirsi_array = (
    '101|Journal of Nature|PBIO|',
    '101|Journal of Nature|http://www.nature.org/|',
    '102|Journal of Crap|PBIO|',
    '102|Journal of Crap|http://www.crap.org/|',
    '102|Journal of Crap|http://www.jstor.org/crap/|',
    );


    This part of the code doesn't look like it has an
    error, but with all those global variables running
    around, we can't be sure. We'll need to see more code
    to help you find the error you're getting.



    HTH,

    Charles K. Clarkson
    --
    Mobile Homes Specialist
    254 968-8328







    Charles Guest

  12. #12

    Default Re: finding out what is uninitialized

    Here are two sample data files and the full script minus a bunch of
    comments that aren't needed..

    Thanks,
    Tim

    Tim McGeary
    Senior Library Systems Specialist
    Lehigh University
    610-758-4998
    edu



    Charles K. Clarkson wrote: 

    PACT|11|
    PART|6|
    PBIO|12|
    PCEM|13
    PCHE|14|
    PCIE|15|
    PCOM|16|
    PECO|17|
    PEDN|8|
    PEES|7|
    PELE|18|
    PENG|19|
    PFIN|20|
    PHIS|22|
    PINE|21|
    PINR|23|
    PJRN|24|
    PLAW|25|
    PLIR|1|
    PMAR|26|
    PMAT|3|
    PMEH|27|
    PMLL|28|
    PMSE|9|
    PMUS|4|
    PPHL|2|
    PPHY|29|
    PPOL|10|
    PPSY|30|
    PREL|31|
    PSOC|32|
    PTHE|33|
    PUND|1|
    PSTF|100|
    #!/s/sirsi/Unicorn/Bin/perl

    ################################################## ###########
    # etexts.pl
    # Tim McGeary

    use warnings;
    use Time::Local;

    my $fund_file = "codes.txt";
    my $sirsi_file = "sample.txt";

    my $fundcoded_file = "ej.title"; # only data that had a valid fund code
    my $etexts = "etexts.data"; # data that will be imported into etext table
    my $disEtexts = "disEtexts.data"; # mapping file of etexts to disciplines
    my $cat_value = 10000000;
    my $reject_file = "reject.title";

    ###### DATE ####
    # getting date

    my ($sec,$min,$hour,$mday,$mon,$year,
    $wday,$yday,$isdst) = localtime time;

    $mon += 1;
    $year += 1900;
    my $date = "$year-$mon-$mday";
    ###### END DATE ####

    ###### BEGIN read in fund.codes ######
    # opens and reads in the fund code file #
    open (FUND,"< $fund_file") or die "Cannot open $fund_file";
    print "Opening $fund_file \n";

    my %codes_hash;
    while (<FUND>) {
    chomp;
    my ($code, $id) = split /\|/;
    $codes_hash{$code} = $id;
    }

    print "Closing $fund_file \n";
    close (FUND);
    ###### END read in fund.codes ######

    ###### BEGIN read in Sirsi data ######
    # reads in Sirsi data that is created by prtentry. The format is the
    # following:
    # |cat_key|Title|Fund_Code or URL|
    #
    # Some records will have more than one URL so it will either be a
    # two or three line record
    #

    # Therefore the cat_key will have to be compared line by line to see
    # where the next record starts
    #
    # Also, an algorithm to keep unique DB_IDs will be 10000000+cat_key
    #

    open (SIRSI,$sirsi_file) or die "Cannot open $sirsi_file";
    print "Opening $sirsi_file to push into array \n";

    my sirsi_array;

    # push each line of this file to an array

    while (<SIRSI>) {
    chomp;
    push(sirsi_array, $_);
    }
    print "Closing $sirsi_file \n";
    close (SIRSI);
    ###### END read in Sirsi data ######

    ###### BEGIN Separating Sirsi data ######
    # pull out unique data from the prtentry data we have

    my $preCat = 0;
    my $titles = 0;
    my $title = '';

    my $code = '';
    my $url = '';
    my fund_array;
    my reject_array;

    my $ezproxy = "http://ezproxy"; # snipped for security purposes

    print "Sorting sirsi data into fundcoded information... \n";

    foreach $item (sirsi_array) {
    my ($temp_key, $temp_title, $data) = split (/\|/, $item);
    if ($preCat != $temp_key) { # new record
    $titles = 0;
    for (keys %codes_hash) {
    if ($data =~ /$_/) {
    $found = 1;
    last;
    }
    }
    if ($found) {
    $titles = 1;
    $code = $data;
    }
    else {
    $titles = 0;
    push(reject_array,"$temp_key\|$temp_title\|");
    next;
    }
    $preCat = $temp_key;
    $found = 0;
    }
    else {
    $title = $temp_title;
    if ($data =~ /jstor/) {
    $title = "$title(archive)";
    }
    elsif ($data =~ /prola/) {
    $title = "$title(archive)";
    }
    $url = "$ezproxy$data";
    $cat_key = $titles * $cat_value + $temp_key;
    push(fund_array,"$cat_key\|$title\|$url\|$code\|" );
    $titles = $titles + 1;
    }
    }
    ##### END Separating Sirsi data #####

    ##### BEGIN saving only fund coded data ######
    # save only data that has a fund code #
    open (FILE,"> $fundcoded_file") or die "Cannot open $fundcoded_file";
    print "Opening $fundcoded_file\n";
    print "Saving data to $fundcoded_file\n";
    foreach $coded (fund_array) {
    printf (FILE "$coded\n");
    }
    print "Closing $fundcoded_file\n\n";
    close (FILE);

    # save reject sirsi data - those w/o fund codes
    open (REJECT,"> $reject_file") or die "Cannot open $reject_file";
    print "Opening $reject_file\n";
    print "Saving data to $reject_file\n";
    foreach $reject (reject_array) {
    printf (REJECT "$reject\n");
    }
    print "Closing $reject_file\n\n";
    close (REJECT);

    ###### END saving only fund coded data ######

    ###### Save tab delimited files for initial db load #######
    open (ETEXTS, "> $etexts") or die "Cannot open $etexts";
    open (DISETEXTS, "> $disEtexts") or die "Cannot open $disEtexts";
    print "Organizing etexts and disEtexts data \n";

    my $lcd = '0';
    my $id = '';
    foreach $item (fund_array) {
    my ($cat_key, $title, $url, $code) = split (/\|/, $item);
    my $descript = $url;
    printf (ETEXTS "$cat_key\t$title\t$url\t$descript\t$code\t$date\t $lcd\n");
    for (keys %codes_hash) {
    if ($code eq $_) {
    $id = $codes_hash{$_};
    last;
    }
    }
    printf (DISETEXTS "$id\t$cat_key\n");
    }
    print "Closing $etexts and $disEtexts\n\n";
    close (ETEXTS);
    close (DISETEXTS);


    671|Psychophysiology|PPSY|
    671|Psychophysiology|http://www.blackwell-synergy.com/servlet/useragent?func=showIssues&code=psyp|
    675|Notes and queries|PENG|
    675|Notes and queries|http://www.bodley.ox.ac.uk/ilej/journals|
    675|Notes and queries|http://www.ingenta.com/journals/browse/oup/notesj|
    676|The Journal of general psychology|http://asa.lib.lehigh.edu/cgi-bin/pubid?Pub=14345|
    681|Greece & Rome|PHIS|
    681|Greece & Rome|http://www.jstor.org/journals/00173835.html|
    681|Greece & Rome|http://www3.oup.co.uk/gromej/contents.html|
    709|Ecology|PEES|
    709|Ecology|http://www.jstor.org/journals/00129658.html|
    709|Ecology|http://asa.lib.lehigh.edu/cgi-bin/pubid?Pub=23845|
    813|Western folklore|http://asa.lib.lehigh.edu/cgi-bin/pubid?Pub=29025|
    843|African affairs|PINR|
    843|African affairs|http://www.jstor.org/journals/00019909.html|
    843|African affairs|http://www3.oup.co.uk/afrafj|
    845|American artist|PART|
    845|American artist|http://asa.lib.lehigh.edu/cgi-bin/pubid?Pub=28020|
    847|The American midland naturalist|PEES|
    847|The American midland naturalist|http://asa.lib.lehigh.edu/cgi-bin/pubid?Pub=28452|
    909|Journal of the American Academy of Religion|PREL|
    909|Journal of the American Academy of Religion|http://asa.lib.lehigh.edu/cgi-bin/pubid?Pub=27977|
    915|Slavic review|PINR|
    915|Slavic review|http://www.jstor.org/journals/00376779.html|
    930|The American Slavic and East European review|http://www.jstor.org/journals/10497544.html|
    953|The China business review|PMAR|
    953|The China business review|http://asa.lib.lehigh.edu/cgi-bin/pubid?Pub=17129|
    965|The Atlantic monthly|http://moa.cit.cornell.edu/moa/browse.journals/atla.html|
    1098|American journal of science|PEES|
    1098|American journal of science|http://www.geology.yale.edu/~ajs/Regular.html|
    1199|Biometrics|PMAT|
    1199|Biometrics|http://www.jstor.org/journals/0006341X.html|
    1199|Biometrics|http://www.blackwell-synergy.com/servlet/useragent?func=showIssues&code=biom|
    1210|Biometrics bulletin|http://www.jstor.org/journals/00994987.html|
    1343|Consumers' research magazine|PMAR|
    1343|Consumers' research magazine|http://asa.lib.lehigh.edu/cgi-bin/pubid?Pub=28909|
    1646|Industrial and engineering chemistry|http://pubs3.acs.org/acs/journals/toc.page?incoden=iecac0|

    Tim Guest

  13. #13

    Default RE: finding out what is uninitialized

    From: Tim McGeary <mailto:EDU> wrote:

    : Here are two sample data files and the full script
    : minus a bunch of comments that aren't needed..



    When I ran the sample.pl script I got this. The
    errors can be eliminated by deleting the blank line
    in sample.txt. I didn't get any errors for line 136.

    HTH,

    Charles K. Clarkson
    --
    Mobile Homes Specialist
    254 968-8328



    Use of uninitialized value in numeric ne (!=) at sample.pl line 94.
    Use of uninitialized value in pattern match (m//) at sample.pl line 97.
    Use of uninitialized value in pattern match (m//) at sample.pl line 97.
    Use of uninitialized value in pattern match (m//) at sample.pl line 97.
    Use of uninitialized value in pattern match (m//) at sample.pl line 97.
    Use of uninitialized value in pattern match (m//) at sample.pl line 97.
    Use of uninitialized value in pattern match (m//) at sample.pl line 97.
    Use of uninitialized value in pattern match (m//) at sample.pl line 97.
    Use of uninitialized value in pattern match (m//) at sample.pl line 97.
    Use of uninitialized value in pattern match (m//) at sample.pl line 97.
    Use of uninitialized value in pattern match (m//) at sample.pl line 97.
    Use of uninitialized value in pattern match (m//) at sample.pl line 97.
    Use of uninitialized value in pattern match (m//) at sample.pl line 97.
    Use of uninitialized value in pattern match (m//) at sample.pl line 97.
    Use of uninitialized value in pattern match (m//) at sample.pl line 97.
    Use of uninitialized value in pattern match (m//) at sample.pl line 97.
    Use of uninitialized value in pattern match (m//) at sample.pl line 97.
    Use of uninitialized value in pattern match (m//) at sample.pl line 97.
    Use of uninitialized value in pattern match (m//) at sample.pl line 97.
    Use of uninitialized value in pattern match (m//) at sample.pl line 97.
    Use of uninitialized value in pattern match (m//) at sample.pl line 97.
    Use of uninitialized value in pattern match (m//) at sample.pl line 97.
    Use of uninitialized value in pattern match (m//) at sample.pl line 97.
    Use of uninitialized value in pattern match (m//) at sample.pl line 97.
    Use of uninitialized value in pattern match (m//) at sample.pl line 97.
    Use of uninitialized value in pattern match (m//) at sample.pl line 97.
    Use of uninitialized value in pattern match (m//) at sample.pl line 97.
    Use of uninitialized value in pattern match (m//) at sample.pl line 97.
    Use of uninitialized value in pattern match (m//) at sample.pl line 97.
    Use of uninitialized value in pattern match (m//) at sample.pl line 97.
    Use of uninitialized value in pattern match (m//) at sample.pl line 97.
    Use of uninitialized value in pattern match (m//) at sample.pl line 97.
    Use of uninitialized value in pattern match (m//) at sample.pl line 97.
    Use of uninitialized value in pattern match (m//) at sample.pl line 97.
    Use of uninitialized value in pattern match (m//) at sample.pl line 97.
    Use of uninitialized value in concatenation (.) or string at sample.pl line
    108.
    Opening codes.txt
    Closing codes.txt
    Opening sample.txt to push into array
    Closing sample.txt
    Sorting sirsi data into fundcoded information...
    Opening ej.title
    Saving data to ej.title
    Closing ej.title

    Opening reject.title
    Saving data to reject.title
    Closing reject.title

    Organizing etexts and disEtexts data
    Closing etexts.data and disEtexts.data



    Charles Guest

  14. #14

    Default Re: finding out what is uninitialized

    The blank line was my mistake of pulling a limited amount of data.
    There is no blank line at the end of my real data file.

    Tim McGeary
    Senior Library Systems Specialist
    Lehigh University
    610-758-4998
    edu



    Charles K. Clarkson wrote: 

    Tim Guest

  15. #15

    Default RE: finding out what is uninitialized

    Tim McGeary <EDU> wrote:

    : The blank line was my mistake of pulling a limited amount
    : of data. There is no blank line at the end of my real
    : data file.

    Then there is also no error. So, what's your question?


    : Charles K. Clarkson wrote:
    : : From: Tim McGeary <mailto:EDU> wrote:
    : :
    : : : Here are two sample data files and the full script
    : : : minus a bunch of comments that aren't needed..
    : :
    : :
    : :
    : : When I ran the sample.pl script I got this. The
    : : errors can be eliminated by deleting the blank line
    : : in sample.txt. I didn't get any errors for line 136.



    Charles K. Clarkson
    --
    Mobile Homes Specialist
    254 968-8328

    Charles Guest

  16. #16

    Default Re: finding out what is uninitialized

    I am still having an error, though. Should I send my full data file?
    It's a bit large.

    Tim

    Tim McGeary
    Senior Library Systems Specialist
    Lehigh University
    610-758-4998
    edu



    Charles K. Clarkson wrote: 



    Tim Guest

  17. #17

    Default RE: finding out what is uninitialized

    From: Tim McGeary <mailto:EDU> wrote:

    : I am still having an error, though. Should I send my full data
    : file? It's a bit large.

    Send it to me off-list.

    HTH,

    Charles K. Clarkson
    --
    Mobile Homes Specialist
    254 968-8328

    Charles Guest

  18. #18

    Default RE: finding out what is uninitialized

    Charles K. Clarkson <mailto:net> wrote:

    : From: Tim McGeary <mailto:EDU> wrote:
    :
    : : I am still having an error, though. Should I send my full
    : : data file? It's a bit large.
    :
    : Send it to me off-list.

    After receiving the file I get three errors. Which,
    as someone already pointed out, is because you are using
    'printf' where you should be using 'print'. But I still
    do not get the other print error you started the thread
    with.

    Are you getting it when you run samlple.pl? Can you
    show us what is being printed when you run the script
    with this data?


    Invalid conversion in printf: "%r" at sample.pl line 99.
    Invalid conversion in printf: "%r" at sample.pl line 126.
    Invalid conversion in printf: "%r" at sample.pl line 126.


    HTH,

    Charles K. Clarkson
    --
    Mobile Homes Specialist
    254 968-8328


    Charles Guest

  19. #19

    Default Re: finding out what is uninitialized

    I don't get any errors either with the sample.pl and sample files. So I
    wonder if the data is bad in the middle of the file. I guess that has
    to be it since I get the errors with sample.pl and the full data file.

    What is the best way to redirect that bad data to a different file or array?

    Tim

    Tim McGeary
    Senior Library Systems Specialist
    Lehigh University
    610-758-4998
    edu



    Charles K. Clarkson wrote: 

    Tim Guest

  20. #20

    Default Re: finding out what is uninitialized

    Tim McGeary wrote: 

    There is no way line 136 can result in an "uninitialized" warning with
    the code you have shown us. That's true irrespective of which data you
    are using.
     

    Which bad data???

    And why didn't you enable strictures before posting your code?

    And why didn't you replace printf() with print() ?

    And why do you keep top posting with full-quotes?

    :(

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
    Gunnar Guest

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 0
    Last Post: September 13th, 02:00 AM
  2. Use of uninitialized value in string eq
    By Fyd in forum PERL Beginners
    Replies: 3
    Last Post: July 9th, 12:25 PM
  3. Net -> SCP - errstr uninitialized
    By Paul Kraus in forum PERL Beginners
    Replies: 3
    Last Post: January 6th, 05:26 AM
  4. Use of uninitialized value
    By B. Fongo in forum Perl / CGI
    Replies: 2
    Last Post: October 28th, 11:49 PM
  5. Testing Uninitialized Vars
    By perl@swanmail.com in forum PERL Beginners
    Replies: 16
    Last Post: October 3rd, 03:39 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

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 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139