I was all ready to hand you the gold star for this solution, until I realized, it drops the key entirely. Try this somewhere in the code you've suggested, and then try it again after putting the url back up into place in the template, manually:
my %params = %{$config{'template'}}; print $params{'home_url'};
However, this works, but isn't as elegant:
print $config{'template'}->{'home_url'};
Update: After screwing my head on straight, I realized that my initializer for %params was before the modification to the hash, and should have been after. This works properly, as it should:
my %config = ParseConfig(\*DATA); for (keys %{$config{template}}) { if (/^http/) { $config{template}{home_url} = $_; delete $config{template}{$_}; last; } } $Data::Dumper::Sortkeys = \%config; print Dumper(\%config); print $params{'home_url'};
Please ignore that man behind the curtain, it's just me making silly mistakes again.
In reply to Re: Unwrapping values in a template
by hacker
in thread Unwrapping values in a template
by hacker
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |