in reply to Re^2: Propose addition to use warnings?
in thread Propose addition to use warnings?
I didn't mean for "not reasonable" to sound like your request is unreasonable. Just that setting the warning there isn't ideal because my_sub could be something like:
sub my_sub { my $closed_handle = shift; die "For some reason our handle isn't closed yet." if $closed_handle->opened; }
...or
close $fh or my_sub($fh); sub my_sub { my $handle = shift; my $error = $handle->error; die "Got this error code: $error\n" if $error; }
...or even...
# Open a handle only if it's not opened. sub my_sub { open $_[0], '<', $_[1] if !$_[0]->opened; }
Dave
|
|---|