in reply to Initializing an anonymous hash
#!/usr/bin/perl -w use strict; use Config::Tiny; use Data::Dumper; my $Config = Config::Tiny->read( 'configfile.txt') or die " $!"; # $Months here is a ref to a hash # my $Months = $Config->{Months}; print Dumper \$Months; =prints $VAR1 = \{ 'Month1' => 'January', 'Month2' => 'February' }; =cut __END__ #file configfile.txt contains this comment and this data #Sample Configuration File [Months] Month1 = January Month2 = February [Another_Section]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Initializing an anonymous hash
by Anonymous Monk on Mar 31, 2012 at 07:51 UTC |