#!/usr/bin/perl use strict; open(IN,"xxxx.in"); while() { /<(\w+)>(.*)<\/\1>/; print ucfirst($1).": $2\n"; } close(IN);