in reply to Re^4: Is { } an empty block or a bug in perl?
in thread Is { } an empty block or a bug in perl?

You can do the same as the last statement in an included file:
$r = do "file.pl"
and in "file.pl"
{}

update: by the way: whether or not you add a "return" to the last statement doesn't make any difference. It just makes it more explicit.

Replies are listed 'Best First'.
Re^6: Is { } an empty block or a bug in perl?
by thor (Priest) on Jul 07, 2005 at 02:24 UTC
    I understand that a subroutine returns the last statement evaluated. I just like the explicit return. It's just a matter of preference.

    thor

    Feel the white light, the light within
    Be your own disciple, fan the sparks of will
    For all of us waiting, your kingdom will come