in reply to Re^2: Fastest byteswap (little endian to big endian (eg. 34127856 -> 12345678)
in thread Fastest byteswap (little endian to big endian (eg. 34127856 -> 12345678)
There is in the second method posted by james28909:
But since it's not copied from one variable to another, it probably makes little difference indeed, I didn't think it through.my $data = do { local $/ = undef; open (my $fh, "<", $input_file) or die "could not open $input_file +: $!"; binmode($fh); <$fh>; }; my $reversed_data = pack( "v*", unpack( "n*", $data ) );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Fastest byteswap (little endian to big endian (eg. 34127856 -> 12345678)
by ikegami (Patriarch) on Apr 14, 2015 at 18:19 UTC | |
by ikegami (Patriarch) on Apr 14, 2015 at 18:42 UTC | |
by Eily (Monsignor) on Apr 15, 2015 at 08:06 UTC | |
by ikegami (Patriarch) on Apr 15, 2015 at 14:07 UTC | |
by Eily (Monsignor) on Apr 15, 2015 at 14:36 UTC | |
|