in reply to why main() call automatically?
G'day Thai Heng,
I suspect you may be confusing the main in main::show_call_information (which is a package and documented in package and perlmod: Packages) with main in main() and sub main {...} (which is a subroutine and documented in perlintro: Basic syntax overview and perlintro: Writing subroutines). [Note: many of the pages I've linked to contain links to further, relevant information.]
main::show_call_information indicates the show_call_information subroutine in the main package; it is not providing information that show_call_information() was called from main(). If that still seems confusing, try changing the name of the main subroutine to something unambiguous: the new output should probably prove enlightening.
You may also find these fairly recent threads to be of interest: "creating a perl entry-point" and "Main routines, unit tests, and sugar".
-- Ken
|
|---|