$ cat config3.tmpl package config3; use Exporter qw(import); our @EXPORT = qw(%config); {$config_hash} 1; ---------- $ cat util2.pm package utils2; require Exporter; use utils1; our @ISA = qw(Exporter); our @EXPORT = qw( redact make_ini); sub redact{ use strict; use warnings; use 5.010; use Path::Tiny; my $file = shift; #use $file; resulted in error use config2; my $sub_hash = "my_github"; my $email = $config{$sub_hash}->{'email'}; my $password = $config{$sub_hash}->{'password'}; my $tempdir = Path::Tiny->tempdir('backup_XXXXXX'); say "temp dir is $tempdir"; my $scratch_file = $tempdir->child('batch_01', '1.manifest.txt')->touchpath; say "scratch_file is $scratch_file"; my $parent = $scratch_file->parent; say "parent is $parent"; chdir $tempdir unless $tempdir->subsumes(Path::Tiny->cwd); system("pwd"); use Data::Dumper; print Dumper \%config; my $b = "dummy"; return $b; } sub make_ini{ use strict; use warnings; use 5.010; use Path::Tiny; my $file = shift; use config2; use Config::Tiny; use Data::Dumper; my $path = shift; say "path is $path"; say "is the stuff here?"; print Dumper \%config; $config->write( $path, 'utf8' ); #this line draws error chdir "/home/bob/Documents"; system("cat *.ini"); my $b = "dummy"; return $b; } 1;