in reply to swap binary data from big to little Endian

I have to add the I've always worked with ASCII strings, so pack and unpack are still magic for me, but I'll keep trying!

No I've tried to unpack the following header:
Position(bytes) Datatype 0 - 7 long 8 - 15 long 16 - 23 long 24 - 31 long 32 - 39 long 40 - 43 int 44 - 51 long
I checked with 'od -l' (on a Unix system):
0000000 0 2000 0 200 0000020 0 455800 0 4 0000040 0 8 2000 275 0000060 281946600 167772160 0000065
I only know that the 6th value is 2000, which is now the 11th value, so I get the impression that it is expected that a long is only 4 bytes, does that make any sense ?

Now, when I do (on Linux)
my @vals = unpack("N*", $binrec ) ; print "@vals" ;
Output
0 2000 0 200 0 455800 0 4 0 8 2000 275 281946600
I get the same values as od except for the last value!
The last thing that confuses me is how to convert a singed/unsiged integer from big to little endian ?

LuCa