in reply to "Subroutine basics" What does -1 mean ?

You already got the right explanation concerning exit, but you seem to be victim of a misunderstanding.

exit has no special meaning within subroutines like e.g. return does, you can use it everywhere.

It just terminates the whole program, if you want a "super-return" on a meta level.

The '-1' is just the "exit code" given to the calling process.

Cheers Rolf

( addicted to the Perl Programming Language)

  • Comment on Re: "Subroutine basics" What does -1 mean ? (not subroutine)