open(FILE, "; close FILE; for(@thing) { if(/this/) { push @other,$_; } elsif(/that/) { push @another,$_; } else { push @crap,$_; } }