The most burning issue to me is that your class is anonymous. The class and all its methods should be defined in a separate Whatever.pm file, which contains the first line "package Whatever;". The magic line with the -w followed by the
use strict;pragma should instead be placed in the main program which itself should indeed be a .pl file - it won't get executed if placed within the .pm file where your class should be defined.