Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Return?

by btrott (Parson)
on Apr 14, 2000 at 19:23 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-19 13:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found