Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
and I have another perl script that access $id and updates it...# identity.pm package id; use strict; use warning; use Exporter; our @ISA = qw(Exporter); our @EXPORT = qw (%id); our $id = ( Name => "Sally", Age => "23"); );
Now I have another script that runs after the previous script (file1.pl). The problem is when I access %id in this script (file2.pl), I want the updated %id values (Jim, 16), but I'm getting the original values ("sally", 23). How would I share package values across files and have updates reflected during each access? Thanks!# file1.pl use id; use strict; use warning; $id{Name} = "Jim"; $id{Age} = 16;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How to update package scoped variables across files?
by hippo (Archbishop) on Aug 25, 2015 at 22:45 UTC | |
Re: How to update package scoped variables across files?
by LanX (Saint) on Aug 26, 2015 at 01:32 UTC | |
Re: How to update package scoped variables across files?
by Monk::Thomas (Friar) on Aug 26, 2015 at 09:31 UTC | |
Re: How to update package scoped variables across files?
by 1nickt (Canon) on Aug 26, 2015 at 00:16 UTC |