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 #### use warnings; use strict; my($buf, $bufq); sub peekline { $bufq or $buf = ; $bufq = 1; $buf; } sub getline { $bufq or $buf = ; $bufq = (); $buf; } while (defined($_ = getline)) { while (defined(peekline) and peekline =~ /^\s/) { $_ .= getline; } print "read one record: \n(($_))\n"; }