I have the following scenario -> 3 files
- module.pl
- a.pl
- b.pl
-------------------Module.pm------------------
use strict;
use warnings;
Package Foo;
our %hash = ( NAME => "NONE" , SSN => "NONE");
----------------------a.pl-------------------
use strict;
use warnings;
use Module;
my $name = "Bill"
my $SSN = "123456789";
# update name and SSN
$Foo::hash{NAME} = $name;
$Foo::hash{SSN} = $SSN;
----------------------b.pl--------------------
use strict;
use warnings;
use Module;
## print the updated values of name and SSN
print "\nUpdated values -> NAME = $Foo::hash{'NAME'} SSN = $Foo::hash{SSN}";
I execute a.pl first and b.pl later. But a.pl gives the updated output but b.pl still gives the old "NONE" output for both fields. I even tried to print the addresses of both has values in a.pl and b.pl and they're different.
Any ideas how can I access the values updated in a.pl into b.pl?
Can't locate object method "Package" via package "Foo"[...]", not the behaviour your describe. Any other differences between what you posted and what you ran?