Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Using array elements for a file search

by onelesd (Pilgrim)
on Oct 24, 2011 at 20:07 UTC ( [id://933472]=note: print w/replies, xml ) Need Help??


in reply to Using array elements for a file search

Code review aside, your example is interesting because you seem to be trying to capture every line of your input file and write it to another file (which can be done in a simpler way than this).

The output to STDOUT looks like it does because you read $INFILE to the end when you checked for the letter "A", so the next time you try to while <$INFILE> {...} for letter "B" the pointer is already at EOF and the while <$INFILE> {...} isn't entered.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-04-24 02:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found