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