use warnings; use strict; while () { while (!/(?:[^;]*+;){2}/) { $_ .= ; } print "read one record: \n(($_))\n"; } __DATA__ The Road Ahead1;Completely Revised and Up-to-Date; 002564418 road ahead2; Americaa creeping revolution;00345678 The road ahead3;[Address made before the Regional Foreign Policy Conference; 004561963