#/usrl/bin/perl -w use Benchmark; $filename = @ARGV[0]; timethese ( $count, {'Method One' => '&One', 'Method Two' => '&Two', 'Method Three' => '&Three'} ); sub One { open(FILE,@ARGV[0]); while($row=) { @data = unpack('a4a2a2a2a2',$row); } close(FILE); } sub Two { open(FILE,@ARGV[0]); while($row=) { ($data[0],$data[1],$data[2],$data[3],$data[4]) = unpack('a4a2a2a2a2',$row); } close(FILE); } sub Three { open(FILE,@ARGV[0]); while($row=) { $data[0] = substr($row,0,4); $data[1] = substr($row,4,2); $data[2] = substr($row,6,2); $data[3] = substr($row,8,2); $data[4] = substr($row,10,2); } close(FILE); }