I have a regex I'm performing on a file that takes a
given string, manipulates it, and replaces the string
with the new string. I want this do be done
recursively on each line in case there are multiple
sections that need to be dealt with. I'm currently
using something like:
while(<$file>){
WHILE:while() {
if ($string =~ /begin(.*?)end/) {
my $perl = $1;
my $eval = eval $perl;
$string =~s/begin.*?end/$eval/;
} else {last WHILE}
}
}
It looks sort of clunky to me, and I don't trust the
subsitution even if it does work, but I can't seem to
get it to work using $perl or $1 in place of the
/.*?/. I was wondering if anyone had any suggestions
for making it nicer, shorter, or cleaner?
~wren
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com