Skip to content

-e 'con' returns 0 on Windows causing the debugger to use stdin #235

Open
@dowy

Description

@dowy

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    perl coreDue to, or likely due to, a perl core changeperl5.34

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions