XYZ.pm ======= #!/usr/bin/perl package XYZ; @ISA = qw(Exporter); @EXPORT_OK = qw(%Hash1 %Hash2 %Hash3) sub populateHashRoutine { # open the file "raw_file.txt" # Populate %Hash1 %Hash2 %Hash3 } 1; main.pl ======== use XYZ; XYZ::populateHashRoutine("raw_file.txt"); How to print Hash1,Hash2,Hash3 values here ?