Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
The problem is in the case that there's no $nick_name, $salutation, or $last_name variables.require $user_file_path; $name = $nick_name || "$salutation $last_name"; $name ||= 'Guest';
I know I could use a regexp or any number of other ways to get rid of that pesky whitespace string, but I'm a stubborn guy who doesn't want to add an extra line of code in there.
What I want is a module or something that I can import which will make it so any string containing only whitespace tests false. I've never written a module and I don't even know if what I want is possible to do, so I need some friendly guideance.
Many thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Truth & Whitespace
by broquaint (Abbot) on May 02, 2003 at 17:08 UTC | |
by PodMaster (Abbot) on May 02, 2003 at 19:25 UTC | |
|
Re: Truth & Whitespace
by chromatic (Archbishop) on May 02, 2003 at 17:18 UTC | |
|
Re: Truth & Whitespace
by artist (Parson) on May 02, 2003 at 17:16 UTC | |
|
Re: Truth & Whitespace
by perlplexer (Hermit) on May 02, 2003 at 17:11 UTC | |
by goofball (Acolyte) on May 02, 2003 at 17:20 UTC | |
by dragonchild (Archbishop) on May 06, 2003 at 13:48 UTC | |
|
Re: Truth & Whitespace
by hardburn (Abbot) on May 02, 2003 at 17:09 UTC |