Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Reading a GPL file: Looping a Byte read

by starbolin (Hermit)
on May 11, 2008 at 21:53 UTC ( [id://685997]=note: print w/replies, xml ) Need Help??


in reply to Reading a GPL file: Looping a Byte read

Could you clarify please? Your code implies that the data is line feed terminated. $/ = "\n"; Is this correct? Is the remainder of the file terminated with a line feed? If your records are line-feed terminated the a fixed length read needs to account for the terminator. One byte for unix, two for Windows. Are you saying that the last line is a partial line? 2600 mod ( 56 + 1) equals 4 ? Either way your last call to read() did retrieve the data and it should be in $out it's just that read returned eof. Just call unpack again after the loop terminates. You need to declare $out outside of the loop so that it is readable outside of the loop. Also be aware that if you call pack on an undersized string some values will not be returned.


s//----->\t/;$~="JAPH";s//\r<$~~/;{s|~$~-|-~$~|||s |-$~~|$~~-|||s,<$~~,<~$~,,s,~$~>,$~~>,, $|=1,select$,,$,,$,,1e-1;print;redo}

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2024-04-20 03:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found