Ok Monks, this is just preliminary experimentation with learning Packages and modules, I'm printing the symbol table keys for a very basic package that's created and called within the same file. However, I'm trying to understand why the printing of the symbol table is repeated twice? is it because of the transition between the package namespace and 'main' namespace. I am assuming this since calling a package exports its symbol table to 'main', hence this code reads the package symbol table in the declared package and then reads the same symbol table after it's been exported with 'require' to 'main', can anyone correct and clear this conjecture please?!
print keys(%newPackage::),"\n";
print "\n\n";
require 'newPackage.pl'; #exporting the package namespace.
newPackage::subroutine1;
package newPackage; #creating the package and its namespace
sub subroutine1 {print "*This is a new package called from within the
+file*\n";}
Excellence is an Endeavor of Persistence.
Chance Favors a Prepared Mind.