AWS-CLI-Config
view release on metacpan or search on metacpan
lib/AWS/CLI/Config.pm view on Meta::CPAN
}
foreach my $line (split /\n/, $contents) {
chomp $line;
$profile = $1 if $line =~ /^\[(?:profile )?([\w]+)\]/;
my ($indent, $key, $value) = $line =~ /^(\s*)([\w]+)\s*=\s*(.*)/;
next if !defined $key or $key eq q{};
if (length $indent) {
$nested->{$key} = $value;
}
else {
# Reset nested hash
$nested = {} if keys %{$nested};
$hash->{$profile}{$key} = ($key and $value) ? $value : $nested;
}
}
return $hash;
( run in 0.540 second using v1.01-cache-2.11-cpan-65fba6d93b7 )