RE: Big endian C to perl on x86 of binary file into structure

2007-09-16 Thread Suresh Govindachar
$Bill wrote: >Suresh Govindachar wrote: >> >> The following code is meant for a Big-endian processor running >> linux. The code reads binary files and assigns values to >> structures. I would like to read the same data files in perl on >> Windows on little endian x86. Any tips on d

Re: Big endian C to perl on x86 of binary file into structure

2007-09-16 Thread Bill Luebkert
Suresh Govindachar wrote: > $Bill wrote: > >Suresh Govindachar wrote: > >> > >> The following code is meant for a Big-endian processor running > >> linux. The code reads binary files and assigns values to > >> structures. I would like to read the same data files in perl on > >> Windo

Fixing a one-liner ("global" binmode?)

2007-09-16 Thread Suresh Govindachar
Hello, The following dos2unix one-liners perl -i~ -pe "s/\r\n$/\n/" fails in windows. I think it is because when perl writes the resulting file, it re-inserts \r\n! The following code almost works: $^I = '~'; my $file_name = $ARGV[0]; my @lines = ();