Subject: | InputOutput::RequireBriefOpen false-positive |
The attached code snippet yields an "InputOutput::RequireBriefOpen"
violation, despite the fact that the open and close are within 9 lines
of each other (the default). Even with the "lines" parameter of that
policy set as high as 20, the violation still appears.
Randy
--
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Randy J. Ray Silicon Valley Scale Modelers:
http://www.svsm.org
rjray@blackperl.com
randy.j.ray@gmail.com
Subject: | briefopen.pl |
#!/usr/bin/perl
use strict;
use warnings;
use Carp 'croak';
my $file = shift;
my ($fh, @lines);
if (! open $fh, '<', $file)
{
croak "Error opening $file for reading: $!";
}
@lines = <$fh>;
if (! close $fh)
{
croak "Error closing $file after reading: $!";
}
exit 0;