use strict; use warnings; while () { if (/^\s*(\w+)[\s:"(]+(.+?)[\s");]*$/) { print "FIRST TERM - $1\n"; print "SECON TERM - $2\n"; } } __DATA__ date : "April 27, 2004"; comment : "Copyright (c) 2002 FoodNation Technolo, Inc. "; power_watts : "1pC"; fruits_vegs_food (1.0, pound);