Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Write a File in Binary?

by Adrade (Pilgrim)
on Jul 03, 2007 at 17:27 UTC ( [id://624738]=note: print w/replies, xml ) Need Help??


in reply to Write a File in Binary?

Hi editi,

First, you're not writing to the file... reformat the third line to read print FILE pack("b*","a","b","c") or die $!;

Additionally, you'll want, after you open FILE, to write binmode(FILE); - I dont know if this is necessary on all platforms, but it certainly can't hurt.

Best of luck,
-Adam

--
By a scallop's forelocks!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-04-25 09:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found