e8fad26e151760333db0a05095936640cbeda1f2
[pkg-perl] / deb-src / libperl-critic-perl / libperl-critic-perl-1.088 / t / InputOutput / ProhibitTwoArgOpen.run
1 ## name basic failures
2 ## failures 12
3 ## cut
4
5 open $fh, ">$output";
6 open($fh, ">$output");
7 open($fh, ">$output") or die;
8
9 open my $fh, ">$output";
10 open(my $fh, ">$output");
11 open(my $fh, ">$output") or die;
12
13 open FH, ">$output";
14 open(FH, ">$output");
15 open(FH, ">$output") or die;
16
17 #This are tricky because the Critic can't
18 #tell where the expression really ends
19 open FH, ">$output" or die;
20 open $fh, ">$output" or die;
21 open my $fh, ">$output" or die;
22
23 #-----------------------------------------------------------------------------
24
25 ## name basic passes
26 ## failures 0
27 ## cut
28
29 open $fh, '>', $output;
30 open($fh, '>', $output);
31 open($fh, '>', $output) or die;
32
33 open my $fh, '>', $output;
34 open(my $fh, '>', $output);
35 open(my $fh, '>', $output) or die;
36
37 open FH, '>', $output;
38 open(FH, '>', $output);
39 open(FH, '>', $output) or die;
40
41 #This are tricky because the Critic can't
42 #tell where the expression really ends
43 open $fh, '>', $output or die;
44 open my $fh, '>', $output or die;
45 open FH, '>', $output or die;
46
47 $foo{open}; # not a function call
48
49 # There is no three-arg equivalent for these
50 open( \*STDOUT, '>&STDERR' );
51 open( *STDOUT, '>&STDERR' );
52 open( STDOUT, '>&STDERR' );
53
54 # Other file modes.
55 open( \*STDOUT, '>>&STDERR' );
56 open( \*STDOUT, '<&STDERR' );
57 open( \*STDOUT, '+>&STDERR' );
58 open( \*STDOUT, '+>>&STDERR' );
59 open( \*STDOUT, '+<&STDERR' );
60
61 #-----------------------------------------------------------------------------
62
63 ## name pass with "use 5.005"
64 ## failures 0
65 ## cut
66
67 open $fh, ">$output";
68 use 5.005;
69
70 #-----------------------------------------------------------------------------
71
72 ## name fail with "use 5.006"
73 ## failures 1
74 ## cut
75
76 open $fh, ">$output";
77 use 5.006;
78
79 #-----------------------------------------------------------------------------
80
81 ##############################################################################
82 #      $URL: http://perlcritic.tigris.org/svn/perlcritic/trunk/Perl-Critic/t/InputOutput/ProhibitTwoArgOpen.run $
83 #     $Date: 2008-06-19 15:03:01 -0500 (Thu, 19 Jun 2008) $
84 #   $Author: clonezone $
85 # $Revision: 2461 $
86 ##############################################################################
87
88 # Local Variables:
89 #   mode: cperl
90 #   cperl-indent-level: 4
91 #   fill-column: 78
92 #   indent-tabs-mode: nil
93 #   c-indentation-style: bsd
94 # End:
95 # ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :