my $infile = "..."; open(my $fh,'<',$infile) or die ("Error open $infile ($!)\n"); my @bytes; my $byte; while(read($fh,$byte,1)) { push(@bytes,$byte);} close($fh); #...