while () { if (my ($word, $time_stamp) = /[#!]\s+(\w+)\s+(\d+)./) { print "[ $word $time_stamp ]\n"; } }