Hi everyone,
I have a question about spaces in directory names.
If I want to use mkdir something, everything works out, but in this case:
I got "booooooo" ..
I tried -e "$file" and -e $file, it doesn't changes anything (what is best practice here?)
I know it has to do with the spaces. But then, this works:
I know that this works because in DOS, directories with spaces are put between quotes. And since -e is a perl function and not DOS, I guess Perl doesn't handle directories with spaces, with quotes.
So how could I solve this problem??
Or am i obliged to type
?
I have a question about spaces in directory names.
If I want to use mkdir something, everything works out, but in this case:
Code:
#!/usr/local/bin/perl # use warnings; $homedir = "C:/SCRIPT/CJ0249A.1/\"Project Information\""; $file = "$homedir/exist.txt"; if (-e "$file") { print ("it exists"); } else {print ("boooo");}
I tried -e "$file" and -e $file, it doesn't changes anything (what is best practice here?)
I know it has to do with the spaces. But then, this works:
Code:
$hide = "attrib -h $file"; system($hide);
So how could I solve this problem??
Or am i obliged to type
Code:
if (-e "c:/blabala/Project\ Information/exist.txt") { print("yes"); }
Comment