You are correct, and there are several ways the OP could fix that problem. The first thing that I thought of would be to simply declare $in prior to the open call. The second was to use the ternary operator.
return open ($in, '<', shift ) ? scalar <$in> : undef; # using undef may or may not be desirable in this caseIn reply to Re^2: what is the return value
by fishmonger
in thread what is the return value
by arasumg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |