I am trying to read a file in the same directory as the Perl script as input and read from it in Windows using Perl.
Code:
$inputFile = getcwd . "/" . <STDIN>;
open (FILE, chomp($inputFile)) or die "Cannot open $inputFile: $!\n";
@lines = <FILE>;
print "@lines\n";
The error I get is:
C:/Documents and Settings/username/workspace/test.pl No such file or directory
Even though that file definitely does exist in that exact form in that exact directory. I've also tried putting the "Documents and Settings" in quotes.