if (defined ref $thingy
let me point out that
ref never returns
undef. If its argument is not a reference,
ref simply returns the empty string (even if called on
To have an idea on what I'm talking about (and on how common this redundant - and sometimes completely wrong - test is), have a look at here.
And to have a confirmation that a test like this is really superfluous (at best), have a look at the docs.
Here is a slightly better crafted search - which searches just for the pattern
defined\s*\(?\s*ref - which gives more results (though some of them are not pertinent to be honest).
Anyway thank everyone for the clarification about the origin of this meme (though now I have the same n1vux's curiosity