perlfunc
gods
<P>
return - get out of a function early
<P>
<HR>
<P>
return
<FONT SIZE=-1>EXPR</FONT>
<P>
return
<P>
<HR>
<P>
Returns from a subroutine, [perlfunc:eval|eval()], or <CODE>do FILE</CODE> with the value given in
<FONT SIZE=-1>EXPR.</FONT> Evaluation of
<FONT SIZE=-1>EXPR</FONT> may be in list, scalar, or void context, depending on how the return value will be used, and the context may vary from one execution to the next (see
[perlfunc:wantarray|wantarray()]). If no
<FONT SIZE=-1>EXPR</FONT> is given, returns an empty list in list context,
an undefined value in scalar context, or nothing in a void context.
<P>
(Note that in the absence of a return, a subroutine, eval, or do
<FONT SIZE=-1>FILE</FONT> will automatically return the value of the last
expression evaluated.)
<HR>