DEVFYI - Developer Resource - FYI

What value is returned by a lone `return;' statement?

Perl Questions and Answers


(Continued from previous question...)

What value is returned by a lone `return;' statement?

The undefined value in scalar context, and the empty list value () in list context.
This way functions that wish to return failure can just use a simple return without worrying about the context in which they were called.

(Continued on next question...)

Other Interview Questions