$binary is not a file handle. It's a normal scalar variable that you've stuffed the entire contents of the file into.
Side note... you're best to use the three argument form of open(), and use a lexical file handle as opposed to a bareword global one:
open my $fh, '<', 'file.ext' or die "Can't open file: $!"; while (<$fh>) { ... }
In reply to Re: Error binmode() on unopened filehandle
by stevieb
in thread Error binmode() on unopened filehandle
by RedJeep
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |