#open ($input, "<", "/root/tables"); while () { /table\s+([^(]+)\s*\(/; print $1; } __DATA__ create table dg_set( dg_seq integer not null, wc_seq integer not null, dg_name varchar(20) not null, comment varchar(50) not null )