## name basic failures
## failures 12
## cut
open $fh, ">$output";
open($fh, ">$output");
open($fh, ">$output") or die;
open my $fh, ">$output";
open(my $fh, ">$output");
open(my $fh, ">$output") or die;
open FH, ">$output";
open(FH, ">$output");
open(FH, ">$output") or die;
#This are tricky because the Critic can't
#tell where the expression really ends
open FH, ">$output" or die;
open $fh, ">$output" or die;
open my $fh, ">$output" or die;
#-----------------------------------------------------------------------------
## name basic passes
## failures 0
## cut
open $fh, '>', $output;
open($fh, '>', $output);
open($fh, '>', $output) or die;
open my $fh, '>', $output;
open(my $fh, '>', $output);
open(my $fh, '>', $output) or die;
open FH, '>', $output;
open(FH, '>', $output);
open(FH, '>', $output) or die;
#This are tricky because the Critic can't
#tell where the expression really ends
open $fh, '>', $output or die;
open my $fh, '>', $output or die;
open FH, '>', $output or die;
$foo{open}; # not a function call
# There is no three-arg equivalent for these
open( \*STDOUT, '>&STDERR' );
open( *STDOUT, '>&STDERR' );
open( STDOUT, '>&STDERR' );
# Other file modes.
open( \*STDOUT, '>>&STDERR' );
open( \*STDOUT, '<&STDERR' );
open( \*STDOUT, '+>&STDERR' );
open( \*STDOUT, '+>>&STDERR' );
open( \*STDOUT, '+<&STDERR' );
#-----------------------------------------------------------------------------
## name pass with "use 5.005"
## failures 0
## cut
open $fh, ">$output";
use 5.005;
#-----------------------------------------------------------------------------
## name fail with "use 5.006"
## failures 1
## cut
open $fh, ">$output";
use 5.006;
#-----------------------------------------------------------------------------
##############################################################################
# $URL: http://perlcritic.tigris.org/svn/perlcritic/trunk/Perl-Critic/t/InputOutput/ProhibitTwoArgOpen.run $
# $Date: 2008-06-19 15:03:01 -0500 (Thu, 19 Jun 2008) $
# $Author: clonezone $
# $Revision: 2461 $
##############################################################################
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
# fill-column: 78
# indent-tabs-mode: nil
# c-indentation-style: bsd
# End:
# ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :