On Mon, Jul 09, 2001 at 05:18:08PM -0400, Morbus Iff wrote:
>  >if ($fileName =~ /\W+/) {
> 
> Use:
> 
>     if ($fileName =~ /[\W+\.]/) {

\W already includes period...  I think you meant:

if ($fileName =~ /[^\w\.]/) {
  # bad, bad filename!
}

Reject the filename if there's any character that's not a word character or
a period.

Ronald

Reply via email to