"David L. Nicol" wrote:
> # with POST
> sub find_first_line_matching_array($\@){
> open F, shift or die "could not open: $!";
> POST{close F};
> while(<F>){
> foreach $w (@{$_[0]}){
> return $_ if /$w/;
> } } }
I'd rather not use POST for resource cleanup at all. Why not
just:
sub find_first_line_matching_array($\@){
my $f = open shift or die "could not open: $!";
while(<$f>){
foreach $w (@{$_[0]}){
return $_ if /$w/;
}
}
We already have object destructors invoked when they go out
of scope. Why not push that technique until we reach a situation
where it doesn't work? Do you have something in mind?
- Ken