All Perl programs should declare variable scope

This means you have to insert
    use strict;
    use warnings;
at the beginning of the file, and this also means that you're going to get an error for every single variable defined. Perl allows, but discourages, not declaring scope. So now everything is errored and it's left as an exercise to @zeinebchelly to declare them with `my`