Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Argument "" isn't numeric in numeric le (<=)

by hotel (Beadle)
on Aug 24, 2009 at 17:53 UTC ( [id://790879]=note: print w/replies, xml ) Need Help??


in reply to Re: Argument "" isn't numeric in numeric le (<=)
in thread Argument "" isn't numeric in numeric le (<=)

Thank you for your comments and replies. I fixed the code after the first message by changing the * to +, and it works fine.

ps: oshall, thank you for your advices. I try to follow most of them when i'm dealing with large files.

But I still do not understand why Perl throws this warning for the dashed lines which do not even go into the loop in which the comparison takes place, instead of pointing to the lines that cause the problem?

Replies are listed 'Best First'.
Re^3: Argument "" isn't numeric in numeric le (<=)
by gone2015 (Deacon) on Aug 25, 2009 at 14:56 UTC

    That's a different question...

    ...the while(substr($line2, 0 , 3) ne "---") loop will certainly stop when $line2 is dashed. However, you enter the loop with $line2 set to the "Gene:" line you just processed, and at the top of the loop you read the next line. So, a dashed line is processed in the loop, and then brings the loop to a halt.

    The inner loop could be recast:

    while ($line2=<geneREAD>) { chomp $line2 ; if (substr($line2, 0 , 3) eq "---") { break ; } ; .... } ;
    ...mind you, you might want to check that the "Gene:" line is followed by something ? But that is part of the general problem of verifying the input.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://790879]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-03-29 05:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found