in reply to Re: validation of posted data.
in thread validation of posted data.

I've found
if ($display =~ /[^\-a-z0-9\.]/) { #err }
to be easiere to read most of the time.
Also if you _read_ the code, Yours says: unless $display is all good chars make an error. Where this says: If there are any illegal chars make an error. I find the latter easiere to understand.

T I M T O W T D I

Replies are listed 'Best First'.
Now appearing as itself... "."!
by BorgCopyeditor (Friar) on Aug 01, 2002 at 04:27 UTC

    Kind of a tangent, here, but isn't "." acceptable by itself (i.e., unescaped) in a character class, since its function as a metacharacter there wouldn't make much sense?

    BCE
    --Your punctuation skills are insufficient!

      Yes I believe it is, but I find it easiere to see that a literal period is required when it is escaped instead of examining the context and determening it from there.

      T I M T O W T D I