Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: Handling undefined string contentby Trinary (Pilgrim) |
on Jan 31, 2001 at 22:42 UTC ( [id://55527]=note: print w/replies, xml ) | Need Help?? |
Explanation: the =~ makes a regular expression bind against a var, instead of $_ / / delimit the regexp. ^ denotes the beginning of a string, $ the end. \s+ means one or more whitespace characters, which is space, \n, \t, \v, or \r. So the whole thing means: do something if, in this var, there's nothing but whitespance between the beginning and end of the contents. Check out perlre. Regular expressions are good. Enjoy Trinary
In Section
Seekers of Perl Wisdom
|
|