in reply to Re: Modifying/Accessing hash in separate script
in thread Modifying/Accessing hash in separate script

I'm afraid you may have misinterpreted what I'm trying to accomplish. There's only going to be one subroutine modifying the has, that's okay. It's a matter of satifying the use strict/use warnings when I try to access members of the hash in other scripts.
  • Comment on Re^2: Modifying/Accessing hash in separate script

Replies are listed 'Best First'.
Re^3: Modifying/Accessing hash in separate script
by Corion (Patriarch) on Jul 22, 2015 at 18:50 UTC

    Can you post a bit of how the hash is declared in the one script, and how it is used in the other?

    Maybe you have

    # config.pl $config{ base_dir } = '/opt/myapp'; $config{ bin_dir } = "$config{ base_dir }/bin";

    ... and then in the main program(s):

    require 'config.pl'; print "My config is $config{ base_dir }\n";

    Then you can add use strict to both files if you add use vars '%config'; to both of them.

      I've added some code to help, thanks for your consideration