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

david2008 has asked for the wisdom of the Perl Monks concerning the following question:

Hi all, I have the following script a.pl
use strict; use warnings; my ($output_file) = 'a.exe'; open INPUT, $output_file or die "Cannot read the installer fil +e $output_file: $!"; binmode INPUT; my $content = ""; my $buffer; while ( read (INPUT, $buffer, 65536) # read in (up to) 64k +chunks, write ) { if ($!){die $!} $content.=$buffer; }; die "Cannot read the installer file $output_file: $!" if $! && + ($! ne 'Bad file descriptor'); close INPUT; return $content;
When i run it on linux it works, but on solaris i get an error message in the read command.
Bad file number at a.pl line 13.<br>
What can be the reason? Thanks, David