in reply to Re: edge case in substitution?
in thread edge case in substitution?
But I think you missed some of the details -- the monk only wants to put in asterisks for certain paramters in the string:
(Sorry, but I didn't see the relevance/need for "use constant" there, so I left it out.)sub obscure { my ($self, $s) = @_; my %tags = qw/fred x wilbur x/; return join '&', map { my ($n,$v) = split /=/; ( exists( %tags{$n} )) ? "$n=".'*' x length($v) : $_ } split /\&/, $s; }
(updated to fix indentation in the code)
|
|---|