in reply to Re: Recursively substitute against multidimensional hash
in thread Recursively substitute against multidimensional hash
How would one call your dive function in this hypothetical case? Because I've tried$work =~ s{%(\w+)(?:\.(\w+))?}{ defined $2 ? $self->{'VARS'}{$1}{$2} : $self->{'VARS'}{default}{$1} }eg;
and even $fml = \%{$self->{'VARS'}}; but not substitution is happening despite cut'n'pasting from your example code which is working fine in another windowd. NGL this is a humiliating way to stumble at the finish line yet here I am.my $fml = $self->{'VARS'}; $work =~ s{ % ( \w+ (?:\.\w+)* ) }{ dive($fml, split /\./, $1) }xegr;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Recursively substitute against multidimensional hash
by Maelstrom (Beadle) on Feb 14, 2025 at 18:32 UTC | |
by haukex (Archbishop) on Feb 15, 2025 at 10:22 UTC |