Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: chomp works but then doesn't??

by AidanLee (Chaplain)
on Dec 18, 2001 at 18:24 UTC ( [id://132825]=note: print w/replies, xml ) Need Help??


in reply to chomp works but then doesn't??

As is often noted on this site is that for data validation it is safest to parse incoming data for valid forms, rather than trying to filter out unwanted things. That way you'll be guaranteed good data, even if you haven't thought of all the things that could go wrong.

in this case, if all that is allowed in that field is letters, you could do a regex on the \w character class to grab only those characters. Magically your end-of-line problems go away.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://132825]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (10)
As of 2024-04-19 08:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found