#! perl -slw use strict; use bytes; open IN, '< :raw', $ARGV[ 0 ] or die "$ARGV[ 0 ] : $!"; open OUT, '> :raw', $ARGV[ 1 ] or die "$ARGV[ 1 ] : $!"; local $/ = \384; ## Read file in 384 byte chunks. while( ) { printf OUT unpack 'x2 a190 x2 a58', $_; } close IN; close OUT; #### #! perl -slw use strict; use bytes; our $FRAMES ||= 1000; binmode STDOUT, ':raw'; for ( 1 .. $FRAMES ) { printf "\xf4X1" . '2' x 188 . "3\xf4X4" . '5' x 56 . '6' . 'X' x 132; } #### |X122 ... 223|X455 ... 556XX ... XX

which after processing should end up as 122 ... 223455 ... 556 #### P:\test>401318-gen.pl -FRAMES=8500000 > 401318.dat P:\test>dir 401318.dat Volume in drive P has no label. Volume Serial Number is BCCA-B4CC Directory of P:\test 24/10/2004 06:54 3,264,000,000 401318.dat 1 File(s) 3,264,000,000 bytes 0 Dir(s) 51,747,094,528 bytes free P:\test>perl -C0 -mbytes -e"BEGIN{$/=\384}" -ne"print unpack 'x2 a190 x2 a58', $_" <401318.dat >401318.out P:\test>dir 401318* Volume in drive P has no label. Volume Serial Number is BCCA-B4CC Directory of P:\test 24/10/2004 06:24 193 401318-gen.pl 24/10/2004 06:54 3,264,000,000 401318.dat 24/10/2004 07:02 2,108,000,000 401318.out 24/10/2004 06:24 303 401318.pl 4 File(s) 5,372,000,496 bytes 0 Dir(s) 49,639,051,264 bytes free