in reply to Use of uninitialized value error

The warning simply means the variable's value is undef.

If $FastaSeqOfDataBase is undefined, then $ArrayFasta[2] is undefined.

If $ArrayFasta[2] is undefined, then the split returned fewer than three strings.

If the split returned fewer than three strings, then $Data contains fewer than two double quotes.

Replies are listed 'Best First'.
Re^2: Use of uninitialized value error
by sumeetgrover (Monk) on Jul 04, 2011 at 20:14 UTC

    Have you used strict at the beginning of the program? I would suggest that. If you already have used strict at the beginning of the program, then I do not see you having 'declared' the variable $FastaSeqOfDataBase with my.

    If this doesn't help, I'd suggest the classic 'Static Verification' technique to dry-run the code with sample data and determine what might cause the error.

    Hope this helps!

Re^2: Use of uninitialized value error
by birdy (Initiate) on Jul 04, 2011 at 20:20 UTC

        And what are you proposing to do as a solution?

        You haven't said enough for us to identify the problem, much less give a solution.

        I'm guessing the problem is either a bad assumption about the format of the file or an incorrect parsing of the file.

          To tell you the truth i haven't understand too much about what are you writing in the previous message.i am begginer in perl programming...

        I forget to write it down but i do

        my $FastaSeqOfDataBase = "";

        in some lines before i call it.

          A very quick method of finding out issues can be introducing temporary 'print' statements in the code. So you could print the value of $FastaSeqOfDataBase after it is assigned a value in the code snippet you pasted. Then see if the value is still undef.

          The log message you've pasted suggests that your code is over 500 lines long, so I guess to one extent it might be difficult for you to put a lot of other background information here.