Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re^2: what is the return value

by fishmonger (Hermit)
on Jul 09, 2013 at 14:42 UTC ( #1043330=note: print w/replies, xml ) Need Help??

in reply to Re: what is the return value
in thread what is the return value

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 case

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1043330]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2016-10-21 10:14 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (288 votes). Check out past polls.