open(FILE, "; close FILE; for(@thing) { if(/this/) { push @other,$_; } elsif(/that/) { push @another,$_; } else { push @crap,$_; } } #### open(FILE, ") { if(/this/) { push @other,$_; } elsif(/that/) { push @another,$_; } else { push @stuff,$_; } } close FILE; #### open(FILE,") { $template .= $line; } close FILE; #### my $template = ''; open(FILE, ") {}; close FILE; die "bad stuff happened" unless length $template;