My issue should be simple but it's driving me crazy. What I am doing is trying to verify whether or not a folder path exists by reading a users input. Here is what I have now but it returns nothing
print "What do you want to save?\n"; my $inp = <>; $inp =~ s/\\/\//g; if ($inp !~ m/^\w+$|^.+$/g) { do { print "Nothing Entered. Try Again - "; $inp = <>; } until ($inp =~ m/^\w+$|^.+$/g) } if ( -d $inp) { print "Folder exists! - \n" }
I eventually would like to verify a file but for now the directory is all I need. Any help would be appreciated
In reply to Verifying If a directory exists by edimusrex
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |