Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Return?

by btrott (Parson)
on Apr 14, 2000 at 19:23 UTC ( #7632=note: print w/replies, xml ) Need Help??


in reply to Return?

You may also think about using a different technique than just testing for carriage returns; it sounds like you'd like to use the default variable basically if the user didn't post any "good text" in the text box. So if they just posted whitespace (whether that be tabs, spaces, or carriage returns), you'd like to use the default variable.

In that case, use something like this:

$variable = "Some Default Messsage" unless $variable =~ /\S/;
This sets variable to the default unless it contains a non-whitespace character.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2022-12-04 18:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?