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:sub readfile { my $filename = shift or return; ... }
defined(my $filename = shift) or return;
In reply to Re: Wrong idioms
by vsespb
in thread Wrong idioms
by McA
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |