Ignoring for now whether that's the right set of reserved characters, your code can be written far more succinctly and efficiently asmy @chars = split //,$folder; foreach (@chars){ if($_ eq "*" || $_ eq '$' || $_ eq "&" || $_ eq "." || $_ eq "?" || + $_ eq '\'){
if ($folder =~ /[$&.?\\]/) {
Dave.
In reply to Re: checking for reserved characters
by dave_the_m
in thread checking for reserved characters
by Real Perl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |