Try like this,
my ($colno) = $_ =~ /<csp c="(\d+)">/; my $csp; for my $i (1..$colno) { $csp = $csp."<colspec colnum=\"$i\" colname=\"col$i\"\/>\n"; } $_=~s/<csp c=\"$colno\">/$csp/g; print "$_";
Punitha
In reply to Re: Making multiple replaces through Regex
by Punitha
in thread Making multiple replaces through Regex
by rsriram
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |