exit(3pm)

πŸ’– NAME πŸ’–

Tk::exit β€” end the application, bestie. like, for real for real, shut it down πŸ‘‘


✨ SYNOPSIS ✨

use Tk qw(exit);
...
exit($returnCode);

okay so the $returnCode part is optional β€” it's a placeholder, not a requirement, iykyk 🫢


🌸 DESCRIPTION 🌸

This one terminates the process and hands returnCode back to the system as the exit status. That's the whole vibe. If you don't pass a returnCode at all, it just defaults to 0 β€” no drama, no fuss, classic πŸ’…

Now here's the slay part: if you're calling exit from code that got invoked via a Tk callback, this Tk version of exit cleans up more reliably than using the plain perl exit. so like, it's giving upgraded exit. it's giving main character cleanup energy. ✨


⚠️ CAVEATS ⚠️

πŸ’€ bestie listen. this one matters.

Using exit from a forked process will terminate both the child process and the parent process. yes, both. the whole family. gone. 😭

And because Tk::exit is imported by default, you should use CORE::exit in the forked process instead. not exit, CORE::exit. don't mix them up, fr fr πŸ™ˆ


πŸ”‘ KEYWORDS πŸ”‘

exit, process β€” the tags, the lore, the search terms πŸ’œ


and that's the page!! written by the perl people, from perl v5.40.1, dated 2025-04-13 β€” ty for coming to my ted talk, mwah πŸŽ€βœ¨πŸ’–

πŸ“¦ where this page comes from