Can some explain how to pass a HASH from a module to main. I've read posts like How to share/export a global variable between two different perl scripts? and understand the basic concept behind it but this is a little different and I can't find any examples.
This module works if called from main, but how do I just pass the hash to main so that I can print in there, instead of printing it from the module. Or so I can write the key values to file or something.
package My::Module;
use strict;
use warnings;
use Exporter;
our @ISA = 'Exporter';
our @EXPORT = qw(get_proc_info);
sub get_proc_info
{
my %processor;
Win32::SystemInfo::ProcessorInfo(%processor);
for (my $i=0;$i<$processor{NumProcessors};$i++)
{
print "Processor $i\n";
print "Processor Name: " . $processor{"Processor$i"}{ProcessorName} . "\n";
print "Processor Info: " . $processor{"Processor$i"}{Identifier} . "\n";
print "Processor Speed: " . $processor{"Processor$i"}{MHZ} . "MHz\n\n";
}
}