You could probably just try making it and if it succeeds it's valid.
use File::Path; eval { mkpath([...args...]) }; # deal with failure or succes
However, I'm with graff. You should whitelist the smallest set of input you'll allow first -- like [-_a-z/] -- and pass it through Path::Class or something to normalize it, or you'll eventually end up with a bad surprise given enough user input.
In reply to Re: How to validate a directory string?
by Your Mother
in thread How to validate a directory string?
by rapide
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |