I've used perl for odd jobs with I/O before
but it's always been plain text.
How do I get integer 0 instead of integer 48
(ascii 0) into a file?
Your question is a little ambiguous because you do not specify what you
mean by an 'integer'.
I am going to assume you want to get a NUL character written to the
file.
#!/usr/bin/perl
use strict;
use warnings;
open my $f, '>', 'bin' or die $!;
print $f "a\0b\0c\n";
close $f or die $!;
__END__
C:\DOCUME~1\asu1\LOCALS~1\Temp> xxd bin
0000000: 6100 6200 630d 0a a.b.c..
--
A. Sinan Unur <
[email protected]>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/