Hi,

Can a 32 bit integer be written to a file in such a way that it is stored in
only 4 bytes ?

I thought that binmoding the filehandle might do this - but  I'm finding
that a number such as 31554399 is consuming 8 bytes (one byte for each
digit), irrespective of whether the filehandle has been binmoded or not.

my $num = 31554399;
open (WRITE, ">test_file")
        or die "Can't open WRITE: $!";
binmode WRITE; # or not
print WRITE $num;
close (WRITE)
         or die "Can't close WRITE: $!";

Cheers,
Rob

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to