in reply to Format string and regex question

You may be better off puting this data into a hash instead of using eval like this.
sub foo { my $format_string = shift; my %vars = ( a => ..., b => ..., c => ..., ); $format_string =~ s/(%(\w))/$vars{$1}/eg; return $format_string; }
That keeps the users out of your name space entirely, and drops the reliance on the 'eval'. This should be tons more efficient for you.