{ $/ = ";\n"; while () { # everything up to/including the next ";\n" has been read into $_ s/\s+/ /g; # normalize all white space to " " if ( /create table (\S+)/ ) { # table definition statement my $tablename = $1; ... } ... } }