... my $Config = Config::Tiny->new; $Config = Config::Tiny->read( $ini_path , 'utf8' ); say Dumper \%Config; my $domain = $Config{$sub_hash}->{'domain'}; my $username = $Config{$sub_hash}->{'username'}; my $password = $Config{$sub_hash}->{'password'}; my $port = $Config{$sub_hash}->{'port'}; ... Global symbol "%Config" requires explicit package name (did you forget + to declare "my %Config"?) at template_stuff/html4.pm line 215. Global symbol "%Config" requires explicit package name (did you forget + to declare "my %Config"?) at template_stuff/html4.pm line 216. Global symbol "%Config" requires explicit package name (did you forget + to declare "my %Config"?) at template_stuff/html4.pm line 217. Global symbol "%Config" requires explicit package name (did you forget + to declare "my %Config"?) at template_stuff/html4.pm line 218. ...
Config::Tiny returns a (blessed) reference to a hash, which is stored in the scalar $Config, so there is no %Config hash available. Both \%Config and $Config{$sub_hash} are however attempting to access a hash named %Config. Instead of Dumper \%Config, do Dumper $Config, and instead of $Config{$sub_hash}, say $Config->{$sub_hash}, and it should work. See perlreftut and perlref.
In reply to Re^5: redacting from config hash
by haukex
in thread redacting from config hash
by Aldebaran
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |