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

Re: File Slurping Problem in Win32 machine

by tcf22 (Priest)
on Sep 17, 2003 at 15:35 UTC ( [id://292146]=note: print w/replies, xml ) Need Help??


in reply to File Slurping Problem in Win32 machine

You could always use read() instead of using <> to slurp in the whole file. I normally use that when dealing with files that contain binary data.
sub EditFile{ my $file = shift; open INFILE,$file; binmode INFILE; my ($buffer, $text); while(read(INFILE, $text, 4096, length($text))){} #Alternative Read method #while(read(INFILE, $buffer, 4096)){ # $text .= $buffer; #} ## close INFILE; # edit text open OUTFILE,">$file"; binmode OUTFILE; print OUTFILE $text; close OUTFILE; }

- Tom

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (7)
As of 2024-03-29 12:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found