summaryrefslogtreecommitdiff
path: root/LedgerSMB
diff options
context:
space:
mode:
authortetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2006-12-05 04:53:13 +0000
committertetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2006-12-05 04:53:13 +0000
commit036f60865172bc36e1468afd64d5ac775fa39529 (patch)
treeff6390d7252a3d6783bf717cf723069f09e1f9a4 /LedgerSMB
parent9328565f48fb505f789c371433088a46b0e6a693 (diff)
Converting 2-arg open to 3-arg open
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@720 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB')
-rwxr-xr-xLedgerSMB/AM.pm10
-rwxr-xr-xLedgerSMB/BP.pm4
-rwxr-xr-xLedgerSMB/Form.pm24
-rwxr-xr-xLedgerSMB/Inifile.pm2
-rwxr-xr-xLedgerSMB/User.pm2
-rwxr-xr-xLedgerSMB/locales.pl10
6 files changed, 26 insertions, 26 deletions
diff --git a/LedgerSMB/AM.pm b/LedgerSMB/AM.pm
index 15ea3e33..23f5658b 100755
--- a/LedgerSMB/AM.pm
+++ b/LedgerSMB/AM.pm
@@ -1278,7 +1278,7 @@ sub load_template {
my ($self, $myconfig, $form) = @_;
$self->check_template_name(\%$myconfig, \%$form);
- open(TEMPLATE, "$form->{file}") or $form->error("$form->{file} : $!");
+ open(TEMPLATE, '<', "$form->{file}") or $form->error("$form->{file} : $!");
while (<TEMPLATE>) {
$form->{body} .= $_;
@@ -1294,7 +1294,7 @@ sub save_template {
my ($self, $myconfig, $form) = @_;
$self->check_template_name(\%$myconfig, \%$form);
- open(TEMPLATE, ">$form->{file}") or $form->error("$form->{file} : $!");
+ open(TEMPLATE, '>', "$form->{file}") or $form->error("$form->{file} : $!");
# strip
$form->{body} =~ s/\r//g;
@@ -1610,9 +1610,9 @@ sub backup {
my $boundary = time;
my $tmpfile = "${LedgerSMB::Sysconfig::userspath}/$boundary.$myconfig->{dbname}-$form->{dbversion}-$t[5]$t[4]$t[3].sql";
$tmpfile .= ".gz" if ${LedgerSMB::Sysconfig::gzip};
- $form->{OUT} = ">$tmpfile";
+ $form->{OUT} = "$tmpfile";
- open(OUT, "$form->{OUT}") or $form->error("$form->{OUT} : $!");
+ open(OUT, '>', "$form->{OUT}") or $form->error("$form->{OUT} : $!");
# get sequences, functions and triggers
@@ -1653,7 +1653,7 @@ sub backup {
if ($form->{media} eq 'file') {
- open(IN, "$tmpfile") or $form->error("$tmpfile : $!");
+ open(IN, '<', "$tmpfile") or $form->error("$tmpfile : $!");
open(OUT, ">-") or $form->error("STDOUT : $!");
print OUT qq|Content-Type: application/file;\n| .
diff --git a/LedgerSMB/BP.pm b/LedgerSMB/BP.pm
index d15dc018..5e43eade 100755
--- a/LedgerSMB/BP.pm
+++ b/LedgerSMB/BP.pm
@@ -342,13 +342,13 @@ sub print_spool {
foreach my $i (1 .. $form->{rowcount}) {
if ($form->{"checked_$i"}) {
- open(OUT, $form->{OUT}) or $form->error("$form->{OUT} : $!");
+ open(OUT, '>', $form->{OUT}) or $form->error("$form->{OUT} : $!");
binmode(OUT);
$spoolfile = qq|$spool/$form->{"spoolfile_$i"}|;
# send file to printer
- open(IN, $spoolfile) or $form->error("$spoolfile : $!");
+ open(IN, '<', $spoolfile) or $form->error("$spoolfile : $!");
binmode(IN);
while (<IN>) {
diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm
index 618a1e3d..7409b4a8 100755
--- a/LedgerSMB/Form.pm
+++ b/LedgerSMB/Form.pm
@@ -84,7 +84,7 @@ sub debug {
my ($self, $file) = @_;
if ($file) {
- open(FH, "> $file") or die $!;
+ open(FH, '>', "$file") or die $!;
for (sort keys %$self) { print FH "$_ = $self->{$_}\n" }
close(FH);
} else {
@@ -577,13 +577,13 @@ sub parse_template {
if ($self->{language_code}) {
if (-f "$self->{templates}/$self->{language_code}/$self->{IN}") {
- open(IN, "$self->{templates}/$self->{language_code}/$self->{IN}") or $self->error("$self->{IN} : $!");
+ open(IN, '<', "$self->{templates}/$self->{language_code}/$self->{IN}") or $self->error("$self->{IN} : $!");
} else {
- open(IN, "$self->{templates}/$self->{IN}") or $self->error("$self->{IN} : $!");
+ open(IN, '<', "$self->{templates}/$self->{IN}") or $self->error("$self->{IN} : $!");
}
} else {
- open(IN, "$self->{templates}/$self->{IN}") or $self->error("$self->{IN} : $!");
+ open(IN, '<', "$self->{templates}/$self->{IN}") or $self->error("$self->{IN} : $!");
}
@_ = <IN>;
@@ -600,11 +600,11 @@ sub parse_template {
if ($self->{format} =~ /(postscript|pdf)/ || $self->{media} eq 'email') {
my $out = $self->{OUT};
- $self->{OUT} = ">$self->{tmpfile}";
+ $self->{OUT} = "$self->{tmpfile}";
}
if ($self->{OUT}) {
- open(OUT, "$self->{OUT}") or $self->error("$self->{OUT} : $!");
+ open(OUT, '>', "$self->{OUT}") or $self->error("$self->{OUT} : $!");
} else {
open(OUT, ">-") or $self->error("STDOUT : $!");
@@ -786,7 +786,7 @@ sub parse_template {
# assume loop after 10 includes of the same file
next if ($include{$var} > 10);
- unless (open(INC, "$self->{templates}/$self->{language_code}/$var")) {
+ unless (open(INC, '<', "$self->{templates}/$self->{language_code}/$var")) {
$err = $!;
$self->cleanup;
$self->error("$self->{templates}/$self->{language_code}/$var : $err");
@@ -890,7 +890,7 @@ sub parse_template {
$myconfig->{signature} =~ s/\\n/$br\n/g;
$mail->{message} .= "$br\n-- $br\n$myconfig->{signature}\n$br" if $myconfig->{signature};
- unless (open(IN, $self->{tmpfile})) {
+ unless (open(IN, '<', $self->{tmpfile})) {
$err = $!;
$self->cleanup;
$self->error("$self->{tmpfile} : $err");
@@ -920,7 +920,7 @@ sub parse_template {
$self->{OUT} = $out;
- unless (open(IN, $self->{tmpfile})) {
+ unless (open(IN, '<', $self->{tmpfile})) {
$err = $!;
$self->cleanup;
$self->error("$self->{tmpfile} : $err");
@@ -935,7 +935,7 @@ sub parse_template {
for my $i (1 .. $self->{copies}) {
if ($self->{OUT}) {
- unless (open(OUT, $self->{OUT})) {
+ unless (open(OUT, '>', $self->{OUT})) {
$err = $!;
$self->cleanup;
$self->error("$self->{OUT} : $err");
@@ -1115,7 +1115,7 @@ sub cleanup {
my @err = ();
if (-f "$self->{errfile}") {
- open(FH, "$self->{errfile}");
+ open(FH, '<', "$self->{errfile}");
@err = <FH>;
close(FH);
}
@@ -1140,7 +1140,7 @@ sub rerun_latex {
my $a = 0;
if (-f "$self->{errfile}") {
- open(FH, "$self->{errfile}");
+ open(FH, '<', "$self->{errfile}");
$a = grep /(longtable Warning:|Warning:.*?LastPage)/, <FH>;
close(FH);
}
diff --git a/LedgerSMB/Inifile.pm b/LedgerSMB/Inifile.pm
index 9922c63c..839c19f3 100755
--- a/LedgerSMB/Inifile.pm
+++ b/LedgerSMB/Inifile.pm
@@ -57,7 +57,7 @@ sub add_file {
for (@{$self->{ORDER}}) { $menuorder{$_} = 1 }
- open FH, "$file" or Form->error("$file : $!");
+ open FH, '<', "$file" or Form->error("$file : $!");
while (<FH>) {
next if /^(#|;|\s)/;
diff --git a/LedgerSMB/User.pm b/LedgerSMB/User.pm
index 8cc551bc..6e4a872e 100755
--- a/LedgerSMB/User.pm
+++ b/LedgerSMB/User.pm
@@ -471,7 +471,7 @@ sub dbsources_unused {
$form->error(__FILE__.':'.__LINE__.": $memfile locked!") if (-f "${memfile}.LCK");
# open members file
- open(FH, "$memfile") or $form->error(__FILE__.':'.__LINE__.": $memfile : $!");
+ open(FH, '<', "$memfile") or $form->error(__FILE__.':'.__LINE__.": $memfile : $!");
while (<FH>) {
if (/^dbname=/) {
diff --git a/LedgerSMB/locales.pl b/LedgerSMB/locales.pl
index 91f61015..0bfc2503 100755
--- a/LedgerSMB/locales.pl
+++ b/LedgerSMB/locales.pl
@@ -110,7 +110,7 @@ foreach $file (@progfiles) {
}
}
- open FH, ">$file" or die "$! : $file";
+ open FH, '>', "$file" or die "$! : $file";
if ($charset) {
print FH qq|\$self{charset} = '$charset';\n\n|;
@@ -179,7 +179,7 @@ $self{subs} = {
if (!$noMissing) {
if (@missing) {
- open FH, ">$file.missing" or die "$! : missing";
+ open FH, '>', "$file.missing" or die "$! : missing";
print FH qq|# module $file
# add the missing texts and run locales.pl to rebuild
@@ -206,7 +206,7 @@ $self{subs} = {
# redo the all file
if ($buildAll) {
- open FH, ">all" or die "$! : all";
+ open FH, '>', "all" or die "$! : all";
print FH q|# These are all the texts to build the translations files.
# to build unique strings edit the module files instead
@@ -255,7 +255,7 @@ sub scanfile {
my $fh = new FileHandle;
return unless (-e $file or $file !~ /custom/);
- open $fh, "$file" or die "$! : $file";
+ open $fh, '<', "$file" or die "$! : $file";
$file =~ s/\.pl//;
$file =~ s/$bindir\///;
@@ -344,7 +344,7 @@ sub scanmenu {
my $file = shift;
my $fh = new FileHandle;
- open $fh, "$file" or die "$! : $file";
+ open $fh, '<', "$file" or die "$! : $file";
my @a = grep /^\[/, <$fh>;
close($fh);