R. Joseph Newton said:

>                                                        The only thing it
> lacked was a meaningful return value.  Since the getTarget function
> provided enough information to decide in favor of an early exit, this
> information should probably be passed on more explicitly, perhaps just by
> returning 0 rather than undef.

Just to pick nits, I think that a plain return here is absolutely correct.
 Or, at least it is in the general case, given that we know nothing about
the return values of this particular function.

The reason?  If you return 0 or an explicit undef, and then call the
function in list context, you will have returned a true value, a list with
one element.  If you just return, then in list context the return value
will be an empty list, which is a false value.  Calling a function in list
context can occur more often that you might imagine, and so I recommend
this as a good habit to get into.

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to