$lines2 = " PERIOD 13 OCT 06 OCT"; $lines2 =~ /\d\d \w\w\w/g; $lines2 =~ s/(\d\d) (\w\w\w)/"\u\L$2 " . ($1 + 0)/eg; $lines2 =~ /(\w\w\w \d\d) \s+ (\w\w\w \d\d)/; print "dates: $1 and $2 \n"; #this line only works with 5.14. #push (@date, map { s/(\d\d) (\w\w\w)/"\u\L$2 " . ($1 + 0)/er } $lines2 =~ /\d\d \w\w\w/g); push (@date, $1); push (@date, $2); $date[0] = $date[0]. ", ". $currentyear; $date1 = $date1. ", ". $currentyear;