Open
Description
On Windows, checking for the existence of the special file con
returns false but opening it works as expected:
if (-e "con") {
print qq[yes\n];
} else {
print qq[no\n];
}
open my $con, '<', 'con' or die qq[Can't open 'con': $!\n];
$_ = <$con>;
print qq[xx $_ xx\n];
"close $con;
produces:
no
hello
xx hello
xx
This has the effect of causing the Perl debugger (perl5db.pl
) to report:
Can't figure out your console, using stdin
Which then means that a debugged program cannot redirect stdin and when an End-of-File is sent to the program while it is reading data from stdin then the debugger terminates and the program and exits.
Can the -e
operator return 1
for the Windows special devices like con
?