in reply to calling a subroutine while Initializing new
Most typically, you would define the subroutine in the package where the constructor is being called -- probably package main;.
Note: for the most part, Perl classes, modules and packages (with the exception of main) are generally spelled in upper and lower case: MyPackage or My::Package -- not in all upper case.
|
|---|