http://www.perlmonks.org?node_id=1026261


in reply to Wrong idioms

sub readfile { my $filename = shift or return; ... }
If this code should only check that filename is defined (i.e. allow empty string), you can write (even for perl <5.10) it like this:
defined(my $filename = shift) or return;