http://www.perlmonks.org?node_id=1057759


in reply to Help! Stuck on methods to count file size.

open my $fh, $filin || die $!;

is not the best way to open a file (check the precedence of operators). Try this:

open my $fh, "<", $filin or die $!;

or:

open (my $fh, "<", $filin) || die $!;