in reply to Use of uninitialized value within

printf $parr[$tmp1]." - $i= @{ [ @PC1[$i] ] } tmp1=$tmp1\n";
Try to print tmp1, with value 64, you havnt nothing for index 8 in array @parr ...

Replies are listed 'Best First'.
Re^2: Use of uninitialized value within
by kennethk (Abbot) on Feb 03, 2015 at 16:43 UTC
    Kita, when providing solutions, please wrap code in <code> tags to keep things properly formatted. Note how your square brackets got mangled into links. I presume you originally intended to write:
    printf $parr[$tmp1]." - $i= @{ [ @PC1[$i] ] } tmp1=$tmp1\n";
    As a side note, you probably shouldn't use printf if print will do (there's no templating in your string), it seems odd that you are both concatenating and interpolating, and why use the baby carriage operator and a slice when a value would be equivalent; why not just
    print "$parr[$tmp1] - $i= $PC1[$i] tmp1=$tmp1\n";

    #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

      I m familiar with java a. And I have learn perl for a short time.So thank for your suggettion very much.