Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Forcing array context on a file handle

by ronmrdechai (Novice)
on Oct 30, 2012 at 21:33 UTC ( #1001561=note: print w/replies, xml ) Need Help??


in reply to Re: Forcing array context on a file handle
in thread Forcing array context on a file handle

That's odd. It works for me too, but it doesn't work in my larger program (I have all the brackets, and in the right order). I have some extra stuff going around with the file handle, so maybe that's what's causing trouble.

I ended up going with BowserUK's solution, which is slightly shorter than the method I was using before.

  • Comment on Re^2: Forcing array context on a file handle

Replies are listed 'Best First'.
Re^3: Forcing array context on a file handle
by Lotus1 (Curate) on Oct 31, 2012 at 02:12 UTC

    After you read a file you have to rewind it with seek if you want to read it again from the beginning. Here is how to set the filehandle back to the beginning of the file.

    seek $fh, 0, 0;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1001561]
help
Chatterbox?
marto has broken
[1nickt]: Discipulus Do the nutritionists in Eataly recommend as we were taught: "Breakfast like a king, lunch like a duke, dinner like a pauper" ?

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (10)
As of 2017-10-19 10:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (252 votes). Check out past polls.

    Notices?