r.joseph has asked for the wisdom of the Perl Monks concerning the following question:
but that never works...it returns different things at different times, but it never replaces all the varibles across the string. What am I doing wrong?sub foo { my $format_string = shift; my $a = ...; my $b = ...; ... my $z = ...; $format_string =~ s/(%(\w))/eval "$$2"/e; return $format_string; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Format string and regex question
by Fastolfe (Vicar) on Jan 01, 2001 at 21:27 UTC | |
|
Re: Format string and regex question
by dws (Chancellor) on Jan 01, 2001 at 15:36 UTC | |
by repson (Chaplain) on Jan 01, 2001 at 16:04 UTC | |
|
Re: Format string and regex question
by I0 (Priest) on Jan 01, 2001 at 20:06 UTC |