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

Re: How to check if a string contains more than 1 character?

by karlgoethebier (Parson)
on May 02, 2013 at 16:24 UTC ( #1031780=note: print w/replies, xml ) Need Help??


in reply to How to check if a string contains more than 1 character?

OK...another (useless?) oneliner:

Karls-Mac-mini:monks karl$ export foo=b Karls-Mac-mini:monks karl$ echo ${foo} | perl -ne '( /.{2,}/ ) ? exit +1 : exit 0;' Karls-Mac-mini:monks karl$ echo $? Karls-Mac-mini:monks karl$ export foo=bar Karls-Mac-mini:monks karl$ echo ${foo} | perl -ne '( /.{2,}/ ) ? exit +1 : exit 0;' Karls-Mac-mini:monks karl$ echo $?

Regards, Karl

«The Crux of the Biscuit is the Apostrophe»

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1031780]
help
Chatterbox?
[pryrt]: 1nickt: academically, perl -MDevel::Peek -lE 'Dump(42); Dump(42.0)'
[chacham]: have you ever wanted to vote -- on a post because of the signature?
[LanX]: susure
[LanX]: good night! :)

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (13)
As of 2017-05-24 20:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?