the_slycer has asked for the wisdom of the Perl Monks concerning the following question:
This works fine on a Linux machine but dies during the $indir open in the second part on a Win32 machine, all the $dir bits work just fine. Poking at the CGI.pm I notice this little bit of code:#!/usr/bin/perl -w use strict; use CGI; my $indir = <STDIN>; chomp $indir; my $dir = 'c:/temp'; print "Opening $dir\n"; opendir (DIR, $dir) || die "Could not open dir: $!"; my @array=readdir (DIR); closedir (DIR); print "$_\n" foreach @array; print "Opening $indir\n"; opendir (INDIR, $indir) || die "Could not open dir: $!"; my @inarray=readdir (INDIR); closedir (INDIR); print "$_\n" foreach @inarray;
If I uncomment those then both opendirs work fine. Can anybody enlighten me as to why this is happening?if ($needs_binmode) { $CGI::DefaultClass->binmode(main::STDOUT); $CGI::DefaultClass->binmode(main::STDIN); $CGI::DefaultClass->binmode(main::STDERR); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32 CGI breaks STDIN?
by chipmunk (Parson) on Feb 01, 2001 at 00:14 UTC | |
by Anonymous Monk on Feb 01, 2001 at 00:35 UTC | |
|
Re: Win32 CGI breaks STDIN?
by the_slycer (Chaplain) on Feb 01, 2001 at 00:07 UTC | |
|
Re: Win32 CGI breaks STDIN?
by $code or die (Deacon) on Feb 01, 2001 at 02:31 UTC | |
|
Re: Win32 CGI breaks STDIN?
by InfiniteSilence (Curate) on Feb 01, 2001 at 21:09 UTC |