Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Oh my, code overload

by chromatic (Archbishop)
on Oct 26, 2001 at 22:17 UTC ( [id://121680]=note: print w/replies, xml ) Need Help??


in reply to Oh my, code overload
in thread Problem with while loop

No, that's wrong. "Slurp mode" is only in effect when $/ has been localized or otherwise set to an undefined value. A filehandle READLINE in scalar context only reads a single line. seek is unnecessary, and is, in fact, probably counterproductive.

It looks to me like the OP has a tab-delimited flatfile. The first line probably lists the headers. The code grabs the field names from the first line with the first read to use as hash keys. Then it loops through the rest of the lines -- the actual data. It's not the most beautiful idiom, but it's valid code, if this is actually the poster's intent.

Replies are listed 'Best First'.
Re: Re: Oh my, code overload
by Hopeless (Initiate) on Oct 26, 2001 at 22:47 UTC
    Yeah, that sounds like what I am trying to do

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2024-04-23 11:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found