Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Searching input file

by tfrayner (Curate)
on Feb 28, 2002 at 00:43 UTC ( #148103=note: print w/ replies, xml ) Need Help??


in reply to Searching input file

Hi,

Without actually running your script I would suggest that it will only return the last item found, and the total number and price of all items found. This is because each iteration of your while loop wipes out the previous entry. The simplest way to get around this would be to print out your info on each iteration rather than at the very end. Alternatively, you might want to use a hash (or array) of arrays (see perlman:perlref for a discussion of references, should you need it).

Other than that, I second the suggestion to use strict and warnings :-)

HTH, Tim


Comment on Re: Searching input file

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (12)
As of 2014-10-20 13:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (76 votes), past polls