in reply to Re: for loop
in thread for loop

hi, thanks for your time and help
but the code
while (<IN>) { s{(<tgroup cols="(.*?)">)}{ "$1\n" . (map { "<colspec colnum='$_' colname='$_'/>\n" } 1..$2) }eg; print OUT; }
just prints <table><tgroup cols="3">3</table>

Replies are listed 'Best First'.
Re^3: for loop
by ikegami (Patriarch) on Aug 11, 2008 at 08:09 UTC
    Oops!
    while (<IN>) { s{(<tgroup cols="(.*?)">)}{ "$1\n" . join('', map { "<colspec colnum='$_' colname='$_'/>\n" } 1..$2) }eg; print OUT; }
      ikegami, thanks for your help. now it works fine for me.