Sometimes I need to see if there is anything in a string, so I looked for a random tutorial from someone I didn’t know to give me the answer, like http://w3mentor.com/learn/perl/perl-string-manipulation/test-empty-strings-in-perl/.
The defined operator is too much to type, so I can use some of the other options I found on that random page:
if($mystring) {
#variable is undefined
}
if($mystring eq undef) {
#variable is undefined
}
Dave Cross says those don’t work and everyone should just use defined.
I actually wrote a lot more in that comment, but they edited it so that the most critical stuff was removed.