#! perl -slw use strict; my( $read, $buf, $ch ); open (FH, '< :raw', $ARGV[ 0 ]) or die $!; while ( $read = sysread( FH, $buf, 4096 ) ) { for my $p ( 0 .. $read ) { $ch = substr $buf, $p, 1; } } close FH;