And now that you've got your solution, here's a way to prevent it (or similar) from happening again:
my $outFileDirectory = "./bin"; + if (-d @outFileDirectory ) { print "There is a directory --> " . $outFileDirectory . "\n" ; } else { print "There is a no such directory --> " . $outFileDirectory . " +\n" ; }
seems to fail cryptically, as you've observed:
There is a no such directory --> ./bin
But if you use strict and warnings:
use strict; use warnings; + my $outFileDirectory = "./bin"; + if (-d @outFileDirectory ) { print "There is a directory --> " . $outFileDirectory . "\n" ; } else { print "There is a no such directory --> " . $outFileDirectory . " +\n" ; }
The path to enlightenment is made shorter:
Global symbol "@outFileDirectory" requires explicit package name at x. +pl line 7. Execution of x.pl aborted due to compilation errors.
In reply to Re: check if directory exists under windows
by liverpole
in thread check if directory exists under windows
by kevind0718
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |