in reply to usage of "my" keyword
Perhaps you are used to languages like PHP that do not require you to declare variables. But there are two extremely compelling reasons to do this:
(1) Tpyos: Yeah, the day will come when, somewhere among thousands of lines of source-code, you will “fat-finger” something. Without variable-declarations, the compiler cannot catch the error ... and, if the compiler does not catch the error, then, pragmatically speaking, neither can you.
(2) Scope: Undeclared variables basically exist “all over the program.” They have whatever value they last contained, from whatever point in the program where their value may happen to have last been set. Thus, “anywhere else in the program, and anytime,” can now interfere with the correct operation of ... “anywhere else in the program, and anytime.”
The Perl language is designed to help address both of these issues, by obliging you to declare variables and by associating a “scope” (visibility + lifetime) to each variable depending on exactly where it is declared. In this way, the Perl compiler can detect nefarious errors that, otherwise, you will never catch. Those errors can (literally ...) cost you a fortune. Never write software without the use strict; use warnings; pragmas in place.