in reply to replace string

hi, Try out this one.
open(DATA,"sample.txt") or die $!; while( $line=<DATA> ) { $line=~s/<(\w+)>/\{$1\}\n/g; $line=~s/<\s(\w+)>/\n\{$1\}\n/g; $line=~s/<\/\w+>//g; print $line; }