in reply to Swaping a record in a File

For this problem, I would consider the use of Tie::File with some code similar to the following:

use Tie::File; tie my @array, 'Tie::File', 'test.data' or die $!; for my $index (0 .. $#array) { unshift @array, splice(@array, $index, 1) if $array[$index] =~ /33 +3/; } untie @array;

 

perl -le "print+unpack'N',pack'B32','00000000000000000000001010100010'"