[Rt-commit] rt branch, 3.8-trunk, updated. rt-3.8.8-249-gc3f38cc

? sunnavy sunnavy at bestpractical.com
Fri Feb 4 00:58:52 EST 2011


The branch, 3.8-trunk has been updated
       via  c3f38ccce846717fac335dd30de525809b380a87 (commit)
      from  b9dda9ccf7f9d645d1bc43a0ff5cf9566060f43a (commit)

Summary of changes:
 bin/rt.in                                          |   10 +++++-----
 bin/webmux.pl.in                                   |    3 ++-
 lib/RT/Handle.pm                                   |    4 ++--
 lib/RT/Installer.pm                                |    2 +-
 lib/RT/Interface/CLI.pm                            |    4 ++--
 lib/RT/Interface/Email.pm                          |    2 +-
 lib/RT/Interface/Web.pm                            |    2 +-
 lib/RT/Test.pm                                     |   18 +++++++++---------
 sbin/extract-message-catalog                       |    2 +-
 sbin/factory                                       |    4 ++--
 sbin/license_tag                                   |   16 ++++++++--------
 sbin/rt-setup-database.in                          |    2 +-
 .../html/Admin/Tools/Shredder/Elements/PluginHelp  |    2 +-
 share/html/Install/index.html                      |    2 +-
 share/html/NoAuth/css/dhandler                     |    2 +-
 t/mail/crypt-gnupg.t                               |    2 +-
 t/mail/gateway.t                                   |   14 +++++++-------
 t/ticket/linking.t                                 |    6 +++---
 t/ticket/scrips_batch.t                            |    2 +-
 t/web/attachment_encoding.t                        |    2 +-
 t/web/command_line.t                               |    2 +-
 21 files changed, 52 insertions(+), 51 deletions(-)

- Log -----------------------------------------------------------------
commit c3f38ccce846717fac335dd30de525809b380a87
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Feb 4 13:38:27 2011 +0800

    add parens for open() call to avoid confusion; also with left 2-arg => 3-arg change

diff --git a/bin/rt.in b/bin/rt.in
index 33428c3..04439ff 100755
--- a/bin/rt.in
+++ b/bin/rt.in
@@ -1166,7 +1166,7 @@ sub submit {
         $file ||= $self->{file};
         local *F;
 
-        open(F, $file) && do {
+        open(F, '<', $file) && do {
             $self->{file} = $file;
             my $sids = $self->{sids} = {};
             while (<F>) {
@@ -1187,7 +1187,7 @@ sub submit {
         $file ||= $self->{file};
         local *F;
 
-        open(F, ">$file") && do {
+        open(F, '>', $file) && do {
             my $sids = $self->{sids};
             foreach my $server (keys %$sids) {
                 foreach my $user (keys %{ $sids->{$server} }) {
@@ -1429,7 +1429,7 @@ sub parse_config_file {
     my ($file) = @_;
     local $_; # $_ may be aliased to a constant, from line 1163
 
-    open(CFG, $file) && do {
+    open(CFG, '<', $file) && do {
         while (<CFG>) {
             chomp;
             next if (/^#/ || /^\s*$/);
@@ -1479,9 +1479,9 @@ sub vi {
     local *F;
     local $/ = undef;
 
-    open(F, ">$file") || die "$file: $!\n"; print F $text; close(F);
+    open(F, '>', $file) or die "$file: $!\n"; print F $text; close(F);
     system($editor, $file) && die "Couldn't run $editor.\n";
-    open(F, $file) || die "$file: $!\n"; $text = <F>; close(F);
+    open(F, '<', $file) or die "$file: $!\n"; $text = <F>; close(F);
     unlink($file);
 
     return $text;
diff --git a/bin/webmux.pl.in b/bin/webmux.pl.in
index 318d1d7..d2745fa 100755
--- a/bin/webmux.pl.in
+++ b/bin/webmux.pl.in
@@ -73,7 +73,8 @@ sub handler {
         # and make all system() and open "|-" dangerouse, for example DBI
         # can get this FD for DB connection and system() call will close
         # by putting grabage into the socket
-        open $protect_fd, '>', '/dev/null' or die "Couldn't open /dev/null: $!";
+        open( $protect_fd, '>', '/dev/null' )
+          or die "Couldn't open /dev/null: $!";
         unless ( fileno($protect_fd) == 1 ) {
             warn "We opened /dev/null to protect FD #1, but descriptor #1 is already occupied";
         }
diff --git a/lib/RT/Handle.pm b/lib/RT/Handle.pm
index 23bfb58..cc4387d 100755
--- a/lib/RT/Handle.pm
+++ b/lib/RT/Handle.pm
@@ -474,10 +474,10 @@ sub InsertSchema {
 
     my (@schema);
 
-    open my $fh_schema, '<', $file or die $!;
+    open( my $fh_schema, '<', $file ) or die $!;
 
     my $has_local = 0;
-    open my $fh_schema_local, "<" . $self->GetVersionFile( $dbh, $RT::LocalEtcPath . "/schema." . $db_type )
+    open( my $fh_schema_local, "<", $self->GetVersionFile( $dbh, $RT::LocalEtcPath . "/schema." . $db_type ))
         and $has_local = 1;
 
     my $statement = "";
diff --git a/lib/RT/Installer.pm b/lib/RT/Installer.pm
index aa89140..1242ae9 100644
--- a/lib/RT/Installer.pm
+++ b/lib/RT/Installer.pm
@@ -278,7 +278,7 @@ sub SaveConfig {
 
     {
         local $/;
-        open my $fh, '<', $file or die $!;
+        open( my $fh, '<', $file ) or die $!;
         $content = <$fh>;
         $content =~ s/^\s*1;\s*$//m;
     }
diff --git a/lib/RT/Interface/CLI.pm b/lib/RT/Interface/CLI.pm
index 33b15b8..af3de59 100755
--- a/lib/RT/Interface/CLI.pm
+++ b/lib/RT/Interface/CLI.pm
@@ -200,7 +200,7 @@ sub GetMessageContent {
     
     #Load the sourcefile, if it's been handed to us
     if ($source) {
-	open SOURCE, '<', $source or die $!;
+    open( SOURCE, '<', $source ) or die $!;
 	@lines = (<SOURCE>);
 	close (SOURCE);
     }
@@ -226,7 +226,7 @@ sub GetMessageContent {
 	system ($ENV{'EDITOR'}, $filename);
     }	
     
-    open READ, '<', $filename or die $!;
+    open( READ, '<', $filename ) or die $!;
     my @newlines = (<READ>);
     close (READ);
 
diff --git a/lib/RT/Interface/Email.pm b/lib/RT/Interface/Email.pm
index 93ffda0..7e7b6a8 100755
--- a/lib/RT/Interface/Email.pm
+++ b/lib/RT/Interface/Email.pm
@@ -445,7 +445,7 @@ sub SendEmail {
             # don't ignore CHLD signal to get proper exit code
             local $SIG{'CHLD'} = 'DEFAULT';
 
-            open my $mail, '|-', "$path $args >/dev/null"
+            open( my $mail, '|-', "$path $args >/dev/null" )
                 or die "couldn't execute program: $!";
 
             # if something wrong with $mail->print we will get PIPE signal, handle it
diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index 7626161..0e51595 100755
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -797,7 +797,7 @@ sub SendStaticFile {
         $type ||= "application/octet-stream";
     }
     $HTML::Mason::Commands::r->content_type($type);
-    open my $fh, '<', $file or die "couldn't open file: $!";
+    open( my $fh, '<', $file ) or die "couldn't open file: $!";
     binmode($fh);
     {
         local $/ = \16384;
diff --git a/lib/RT/Test.pm b/lib/RT/Test.pm
index b9de54e..9ba3e65 100644
--- a/lib/RT/Test.pm
+++ b/lib/RT/Test.pm
@@ -217,7 +217,7 @@ sub bootstrap_config {
     $tmp{'config'}{'RT'} = File::Spec->catfile(
         "$tmp{'directory'}", 'RT_SiteConfig.pm'
     );
-    open my $config, '>', $tmp{'config'}{'RT'}
+    open( my $config, '>', $tmp{'config'}{'RT'} )
         or die "Couldn't open $tmp{'config'}{'RT'}: $!";
 
     print $config qq{
@@ -246,7 +246,7 @@ Set( \$RTAddressRegexp , qr/^bad_re_that_doesnt_match\$/);
 Set( \$MailCommand, sub {
     my \$MIME = shift;
 
-    open my \$handle, '>>', '$mail_catcher'
+    open( my \$handle, '>>', '$mail_catcher' )
         or die "Unable to open '$mail_catcher' for appending: \$!";
 
     \$MIME->print(\$handle);
@@ -272,7 +272,7 @@ sub bootstrap_logging {
     $tmp{'log'}{'RT'} = File::Spec->catfile(
         "$tmp{'directory'}", 'rt.debug.log'
     );
-    open my $fh, '>', $tmp{'log'}{'RT'}
+    open( my $fh, '>', $tmp{'log'}{'RT'} )
         or die "Couldn't open $tmp{'config'}{'RT'}: $!";
     # make world writable so apache under different user
     # can write into it
@@ -303,7 +303,7 @@ sub set_config_wrapper {
                 SCALAR => '$',
             );
             my $sigil = $sigils{$type} || $sigils{'SCALAR'};
-            open my $fh, '>>', $tmp{'config'}{'RT'}
+            open( my $fh, '>>', $tmp{'config'}{'RT'} )
                 or die "Couldn't open config file: $!";
             require Data::Dumper;
             my $dump = Data::Dumper::Dumper([@_[2 .. $#_]]);
@@ -774,7 +774,7 @@ sub open_mailgate_ok {
     my $baseurl = shift;
     my $queue   = shift || 'general';
     my $action  = shift || 'correspond';
-    Test::More::ok(open(my $mail, "|$RT::BinPath/rt-mailgate --url $baseurl --queue $queue --action $action"), "Opened the mailgate - $!");
+    Test::More::ok(open(my $mail, '|-', "$RT::BinPath/rt-mailgate --url $baseurl --queue $queue --action $action"), "Opened the mailgate - $!");
     return $mail;
 }
 
@@ -1069,7 +1069,7 @@ sub start_apache_server {
     my %info = $self->apache_server_info( variant => $variant );
 
     Test::More::diag(do {
-        open my $fh, '<', $tmp{'config'}{'RT'};
+        open( my $fh, '<', $tmp{'config'}{'RT'} ) or die $!;
         local $/;
         <$fh>
     });
@@ -1115,7 +1115,7 @@ sub start_apache_server {
         }
         Test::More::BAIL_OUT("Couldn't start apache server, no pid file")
             unless -e $opt{'pid_file'};
-        open my $pid_fh, '<', $opt{'pid_file'}
+        open( my $pid_fh, '<', $opt{'pid_file'} )
             or Test::More::BAIL_OUT("Couldn't open pid file: $!");
         my $pid = <$pid_fh>;
         chomp $pid;
@@ -1227,7 +1227,7 @@ sub file_content {
 
     Test::More::diag "reading content of '$path'" if $ENV{'TEST_VERBOSE'};
 
-    open my $fh, "<:raw", $path
+    open( my $fh, "<:raw", $path )
         or do {
             warn "couldn't open file '$path': $!" unless $args{noexist};
             return ''
@@ -1286,7 +1286,7 @@ sub process_in_file {
         ($out_fh, $out_conf) = tempfile();
     } else {
         $out_conf = $args{'out'};
-        open $out_fh, '>', $out_conf
+        open( $out_fh, '>', $out_conf )
             or die "couldn't open '$out_conf': $!";
     }
     print $out_fh $text;
diff --git a/sbin/extract-message-catalog b/sbin/extract-message-catalog
index 586feff..f36e6ba 100755
--- a/sbin/extract-message-catalog
+++ b/sbin/extract-message-catalog
@@ -343,7 +343,7 @@ sub update {
         $out .= 'msgid ' . fmt($_) . "msgstr \"$Lexicon{$_}\"\n\n";
     }
 
-    open PO, '>', $file or die "Couldn't open '$file' for writing: $!";
+    open( PO, '>', $file ) or die "Couldn't open '$file' for writing: $!";
     print PO $out;
     close PO;
 
diff --git a/sbin/factory b/sbin/factory
index a42a13f..3d9c798 100755
--- a/sbin/factory
+++ b/sbin/factory
@@ -452,11 +452,11 @@ $ClassAccessible
     print "About to make $RecordClassPath, $CollectionClassPath\n";
     `mkdir -p $path`;
 
-    open( RECORD, ">$RecordClassPath" );
+    open( RECORD, '>', $RecordClassPath ) or die $!;
     print RECORD $RecordClass;
     close(RECORD);
 
-    open( COL, ">$CollectionClassPath" );
+    open( COL, '>', $CollectionClassPath ) or die $!;
     print COL $CollectionClass;
     close(COL);
 
diff --git a/sbin/license_tag b/sbin/license_tag
index b55b310..aa5a2d9 100755
--- a/sbin/license_tag
+++ b/sbin/license_tag
@@ -112,7 +112,7 @@ sub tag_mason {
         my $pm = $_;
         return unless (-f $pm);
         return if $pm =~ /images/ || $pm =~ /\.(?:png|jpe?g|gif)$/;
-        open FILE, '<' $pm or die "Failed to open $pm";
+        open( FILE, '<', $pm ) or die "Failed to open $pm";
         my $file = (join "", <FILE>); 
         close (FILE);
         print "$pm - ";
@@ -135,7 +135,7 @@ sub tag_mason {
         
 
 
-        open FILE, '>', $pm or die "couldn't write new file";
+        open( FILE, '>', $pm ) or die "couldn't write new file";
         print FILE $file;
         close FILE;
 
@@ -144,7 +144,7 @@ sub tag_mason {
 
 sub tag_makefile {
         my $pm = shift;
-        open FILE, '<', $pm or die "Failed to open $pm";
+        open( FILE, '<', $pm ) or die "Failed to open $pm";
         my $file = (join "", <FILE>); 
         close (FILE);
         print "$pm - ";
@@ -167,7 +167,7 @@ sub tag_makefile {
         
 
 
-        open FILE, '>', $pm or die "couldn't write new file";
+        open( FILE, '>', $pm ) or die "couldn't write new file";
         print FILE $file;
         close FILE;
 
@@ -177,7 +177,7 @@ sub tag_makefile {
 sub tag_pm {
         my $pm = $_;
         next unless $pm =~ /\.pm/s;
-        open FILE, '<', $pm or die "Failed to open $pm";
+        open( FILE, '<', $pm ) or die "Failed to open $pm";
         my $file = (join "", <FILE>); 
         close (FILE);
         print "$pm - ";
@@ -200,7 +200,7 @@ sub tag_pm {
         
 
 
-        open FILE, '>', $pm or die "couldn't write new file $pm";
+        open( FILE, '>', $pm ) or die "couldn't write new file $pm";
         print FILE $file;
         close FILE;
 
@@ -210,7 +210,7 @@ sub tag_pm {
 sub tag_script {
         my $pm = $_;
         return unless (-f $pm);
-        open FILE, '<', $pm or die "Failed to open $pm";
+        open( FILE, '<', $pm ) or die "Failed to open $pm";
         my $file = (join "", <FILE>); 
         close (FILE);
         print "$pm - ";
@@ -236,7 +236,7 @@ sub tag_script {
         print "\n";
         
 
-        open FILE, '>', $pm or die "couldn't write new file";
+        open( FILE, '>', $pm ) or die "couldn't write new file";
         print FILE $file;
         close FILE;
 
diff --git a/sbin/rt-setup-database.in b/sbin/rt-setup-database.in
index 87e8b09..6d9bf88 100755
--- a/sbin/rt-setup-database.in
+++ b/sbin/rt-setup-database.in
@@ -339,7 +339,7 @@ sub action_upgrade {
 sub get_versions_from_to {
     my ($base_dir, $from, $to) = @_;
 
-    opendir my $dh, $base_dir or die "couldn't open dir: $!";
+    opendir( my $dh, $base_dir ) or die "couldn't open dir: $!";
     my @versions = grep -d "$base_dir/$_" && /\d+\.\d+\.\d+/, readdir $dh;
     closedir $dh;
 
diff --git a/share/html/Admin/Tools/Shredder/Elements/PluginHelp b/share/html/Admin/Tools/Shredder/Elements/PluginHelp
index 59861ea..7e1ac48 100644
--- a/share/html/Admin/Tools/Shredder/Elements/PluginHelp
+++ b/share/html/Admin/Tools/Shredder/Elements/PluginHelp
@@ -65,7 +65,7 @@ unless( $file ) {
 
 use RT::Shredder::POD qw();
 my $text = '';
-open my $io_handle, ">:scalar", \$text or die "Can't open scalar for write: $!";
+open( my $io_handle, ">:scalar", \$text ) or die "Can't open scalar for write: $!";
 RT::Shredder::POD::plugin_html( $file, $io_handle );
 if ( $Plugin eq 'Base' ) {
     $file =~ s/\.pm$/\/Search.pm/;
diff --git a/share/html/Install/index.html b/share/html/Install/index.html
index 37fbf64..6d7b3f0 100644
--- a/share/html/Install/index.html
+++ b/share/html/Install/index.html
@@ -95,7 +95,7 @@ my $file = File::Spec->catfile( $RT::EtcPath, 'RT_SiteConfig.pm' );
 
 if ( ! -e $file ) {
     # write a blank RT_SiteConfig.pm
-    open my $fh, '>', $file or die $!;
+    open( my $fh, '>', $file ) or die $!;
     close $fh;
 }
 elsif ( ! -w $file ) {
diff --git a/share/html/NoAuth/css/dhandler b/share/html/NoAuth/css/dhandler
index e428890..7fa851e 100644
--- a/share/html/NoAuth/css/dhandler
+++ b/share/html/NoAuth/css/dhandler
@@ -70,7 +70,7 @@ sub file_handle {
     my $self = shift;
     my $file = shift;
     my $content = $self->{'mason'}->scomp($file) || '';
-    open my $fh, '<', \$content or die "$!";
+    open( my $fh, '<', \$content ) or die "$!";
     return $fh;
 }
 
diff --git a/t/mail/crypt-gnupg.t b/t/mail/crypt-gnupg.t
index e6ab562..cc52dd6 100644
--- a/t/mail/crypt-gnupg.t
+++ b/t/mail/crypt-gnupg.t
@@ -285,7 +285,7 @@ diag 'wrong signed/encrypted parts: wrong proto' if $ENV{'TEST_VERBOSE'};
 
 diag 'verify inline and in attachment signatures' if $ENV{'TEST_VERBOSE'};
 {
-    open my $fh, '<', "$homedir/signed_old_style_with_attachment.eml" or die $!;
+    open( my $fh, '<', "$homedir/signed_old_style_with_attachment.eml" ) or die $!;
     my $parser = new MIME::Parser;
     my $entity = $parser->parse( $fh );
 
diff --git a/t/mail/gateway.t b/t/mail/gateway.t
index 00de1ec..d57b063 100644
--- a/t/mail/gateway.t
+++ b/t/mail/gateway.t
@@ -621,7 +621,7 @@ ok( $id, 'new ticket created' );
 is( $tick->Owner, $RT::Nobody->Id, 'owner of the new ticket is nobody' );
 
 $! = 0;
-ok(open(MAIL, "|$RT::BinPath/rt-mailgate --url $url --queue ext-mailgate --action take"), "Opened the mailgate - $!");
+ok(open(MAIL, '|-', "$RT::BinPath/rt-mailgate --url $url --queue ext-mailgate --action take"), "Opened the mailgate - $!");
 print MAIL <<EOF;
 From: root\@localhost
 Subject: [@{[RT->Config->Get('rtname')]} \#$id] test
@@ -645,7 +645,7 @@ is( $tick->Owner, $RT::Nobody->Id, 'set owner back to nobody');
 
 
 $! = 0;
-ok(open(MAIL, "|$RT::BinPath/rt-mailgate --url $url --queue ext-mailgate --action take-correspond"), "Opened the mailgate - $@");
+ok(open(MAIL, '|-', "$RT::BinPath/rt-mailgate --url $url --queue ext-mailgate --action take-correspond"), "Opened the mailgate - $@");
 print MAIL <<EOF;
 From: root\@localhost
 Subject: [@{[RT->Config->Get('rtname')]} \#$id] correspondence
@@ -669,7 +669,7 @@ is( $tick->Transactions->Count, 6, 'no superfluous transactions');
 is( $txns->First->Subject, "[$RT::rtname \#$id] correspondence", 'successfuly add correspond within take via email' );
 
 $! = 0;
-ok(open(MAIL, "|$RT::BinPath/rt-mailgate --url $url --queue ext-mailgate --action resolve"), "Opened the mailgate - $!");
+ok(open(MAIL, '|-', "$RT::BinPath/rt-mailgate --url $url --queue ext-mailgate --action resolve"), "Opened the mailgate - $!");
 print MAIL <<EOF;
 From: root\@localhost
 Subject: [@{[RT->Config->Get('rtname')]} \#$id] test
@@ -703,7 +703,7 @@ ok( $id, 'create new ticket' );
 my $rtname = RT->Config->Get('rtname');
 
 $! = 0;
-ok(open(MAIL, "|$RT::BinPath/rt-mailgate --url $url --queue ext-mailgate --action take"), "Opened the mailgate - $!");
+ok(open(MAIL, '|-', "$RT::BinPath/rt-mailgate --url $url --queue ext-mailgate --action take"), "Opened the mailgate - $!");
 print MAIL <<EOF;
 From: ext-mailgate\@localhost
 Subject: [$rtname \#$id] test
@@ -721,7 +721,7 @@ my $ace_id = $status;
 ok( $user->HasRight( Right => 'ReplyToTicket', Object => $tick ), "User can reply to ticket" );
 
 $! = 0;
-ok(open(MAIL, "|$RT::BinPath/rt-mailgate --url $url --queue ext-mailgate --action correspond-take"), "Opened the mailgate - $!");
+ok(open(MAIL, '|-', "$RT::BinPath/rt-mailgate --url $url --queue ext-mailgate --action correspond-take"), "Opened the mailgate - $!");
 print MAIL <<EOF;
 From: ext-mailgate\@localhost
 Subject: [$rtname \#$id] test
@@ -736,7 +736,7 @@ cmp_ok( $tick->Owner, '!=', $user->id, "we didn't change owner" );
 is( $tick->Transactions->Count, 3, "one transactions added" );
 
 $! = 0;
-ok(open(MAIL, "|$RT::BinPath/rt-mailgate --url $url --queue ext-mailgate --action take-correspond"), "Opened the mailgate - $!");
+ok(open(MAIL, '|-', "$RT::BinPath/rt-mailgate --url $url --queue ext-mailgate --action take-correspond"), "Opened the mailgate - $!");
 print MAIL <<EOF;
 From: ext-mailgate\@localhost
 Subject: [$rtname \#$id] test
@@ -777,7 +777,7 @@ ok( $status, "successfuly granted right: $msg" );
 ok( $status, "successfuly granted right: $msg" );
 
 $! = 0;
-ok(open(MAIL, "|$RT::BinPath/rt-mailgate --url $url --queue ext-mailgate --action take-correspond"), "Opened the mailgate - $!");
+ok(open(MAIL, '|-', "$RT::BinPath/rt-mailgate --url $url --queue ext-mailgate --action take-correspond"), "Opened the mailgate - $!");
 print MAIL <<EOF;
 From: ext-mailgate\@localhost
 Subject: [$rtname \#$id] test
diff --git a/t/ticket/linking.t b/t/ticket/linking.t
index a538fb1..fc4761d 100644
--- a/t/ticket/linking.t
+++ b/t/ticket/linking.t
@@ -38,14 +38,14 @@ my $q2 = RT::Queue->new($RT::SystemUser);
 ok ($id,$msg);
 
 my $commit_code = <<END;
-open my \$file, '<', "$filename" or die "couldn't open $filename";
+open( my \$file, '<', "$filename" ) or die "couldn't open $filename";
 my \$data = <\$file>;
 chomp \$data;
 \$data += 0;
 close \$file;
 \$RT::Logger->debug("Data is \$data");
 
-open \$file, '>', "$filename" or die "couldn't open $filename";
+open( \$file, '>', "$filename" ) or die "couldn't open $filename";
 if (\$self->TransactionObj->Type eq 'AddLink') {
     \$RT::Logger->debug("AddLink");
     print \$file \$data+1, "\n";
@@ -375,7 +375,7 @@ ok($link->LocalBase   == 0, "LocalBase set correctly");
 
 sub link_count {
     my $file = shift;
-    open my $fh, '<', $file or die "couldn't open $file";
+    open ( my $fh, '<', $file ) or die "couldn't open $file";
     my $data = <$fh>;
     close $fh;
 
diff --git a/t/ticket/scrips_batch.t b/t/ticket/scrips_batch.t
index f558d3b..f13881b 100644
--- a/t/ticket/scrips_batch.t
+++ b/t/ticket/scrips_batch.t
@@ -45,7 +45,7 @@ my $sid;
     my ($tmp_fh, $tmp_fn) = tempfile();
 
     my $code = <<END;
-open my \$fh, '>', '$tmp_fn' or die "Couldn't open '$tmp_fn':\$!";
+open( my \$fh, '>', '$tmp_fn' ) or die "Couldn't open '$tmp_fn':\$!";
 
 my \$batch = \$self->TicketObj->TransactionBatch;
 unless ( \$batch && \@\$batch ) {
diff --git a/t/web/attachment_encoding.t b/t/web/attachment_encoding.t
index 6796c99..9ba5677 100644
--- a/t/web/attachment_encoding.t
+++ b/t/web/attachment_encoding.t
@@ -48,7 +48,7 @@ diag 'test with attachemnts' if $ENV{TEST_VERBOSE};
 
     my $file =
       File::Spec->catfile( File::Spec->tmpdir, 'rt_attachemnt_abcde.txt' );
-    open my $fh, '>', $file or die $!;
+    open( my $fh, '>', $file ) or die $!;
     binmode $fh, ':utf8';
     print $fh '附件';
     close $fh;
diff --git a/t/web/command_line.t b/t/web/command_line.t
index e8e2367..884b064 100644
--- a/t/web/command_line.t
+++ b/t/web/command_line.t
@@ -532,7 +532,7 @@ sub check_attachment {
     expect_handle->before() =~ $attachment_regex;
     my $attachment_id = $1;
     expect_send("show ticket/$ticket_id/attachments/$attachment_id/content","Fetching Attachment");
-    open my $fh, '<', $attachment_path or die "Can't open $attachment_path: $!";
+    open( my $fh, '<', $attachment_path ) or die "Can't open $attachment_path: $!";
     my $attachment_content = do { local($/); <$fh> };
     close $fh;
     chomp $attachment_content;

-----------------------------------------------------------------------


More information about the Rt-commit mailing list