[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb: [720] trunk
- Subject: SF.net SVN: ledger-smb: [720] trunk
- From: ..hidden..
- Date: Mon, 04 Dec 2006 20:53:13 -0800
Revision: 720
http://svn.sourceforge.net/ledger-smb/?rev=720&view=rev
Author: tetragon
Date: 2006-12-04 20:53:13 -0800 (Mon, 04 Dec 2006)
Log Message:
-----------
Converting 2-arg open to 3-arg open
Modified Paths:
--------------
trunk/LedgerSMB/AM.pm
trunk/LedgerSMB/BP.pm
trunk/LedgerSMB/Form.pm
trunk/LedgerSMB/Inifile.pm
trunk/LedgerSMB/User.pm
trunk/LedgerSMB/locales.pl
trunk/bin/admin.pl
trunk/bin/am.pl
trunk/bin/login.pl
trunk/dists/win32/shebang-activeperl.pl
trunk/dists/win32/shebang-vanilla.pl
trunk/import_members.pl
trunk/setup.pl
trunk/utils/notify_short/listener.pl
Modified: trunk/LedgerSMB/AM.pm
===================================================================
--- trunk/LedgerSMB/AM.pm 2006-12-05 04:21:13 UTC (rev 719)
+++ trunk/LedgerSMB/AM.pm 2006-12-05 04:53:13 UTC (rev 720)
@@ -1278,7 +1278,7 @@
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 @@
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 @@
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 @@
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| .
Modified: trunk/LedgerSMB/BP.pm
===================================================================
--- trunk/LedgerSMB/BP.pm 2006-12-05 04:21:13 UTC (rev 719)
+++ trunk/LedgerSMB/BP.pm 2006-12-05 04:53:13 UTC (rev 720)
@@ -342,13 +342,13 @@
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>) {
Modified: trunk/LedgerSMB/Form.pm
===================================================================
--- trunk/LedgerSMB/Form.pm 2006-12-05 04:21:13 UTC (rev 719)
+++ trunk/LedgerSMB/Form.pm 2006-12-05 04:53:13 UTC (rev 720)
@@ -84,7 +84,7 @@
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 @@
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 @@
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 @@
# 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 @@
$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 @@
$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 @@
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 @@
my @err = ();
if (-f "$self->{errfile}") {
- open(FH, "$self->{errfile}");
+ open(FH, '<', "$self->{errfile}");
@err = <FH>;
close(FH);
}
@@ -1140,7 +1140,7 @@
my $a = 0;
if (-f "$self->{errfile}") {
- open(FH, "$self->{errfile}");
+ open(FH, '<', "$self->{errfile}");
$a = grep /(longtable Warning:|Warning:.*?LastPage)/, <FH>;
close(FH);
}
Modified: trunk/LedgerSMB/Inifile.pm
===================================================================
--- trunk/LedgerSMB/Inifile.pm 2006-12-05 04:21:13 UTC (rev 719)
+++ trunk/LedgerSMB/Inifile.pm 2006-12-05 04:53:13 UTC (rev 720)
@@ -57,7 +57,7 @@
for (@{$self->{ORDER}}) { $menuorder{$_} = 1 }
- open FH, "$file" or Form->error("$file : $!");
+ open FH, '<', "$file" or Form->error("$file : $!");
while (<FH>) {
next if /^(#|;|\s)/;
Modified: trunk/LedgerSMB/User.pm
===================================================================
--- trunk/LedgerSMB/User.pm 2006-12-05 04:21:13 UTC (rev 719)
+++ trunk/LedgerSMB/User.pm 2006-12-05 04:53:13 UTC (rev 720)
@@ -471,7 +471,7 @@
$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=/) {
Modified: trunk/LedgerSMB/locales.pl
===================================================================
--- trunk/LedgerSMB/locales.pl 2006-12-05 04:21:13 UTC (rev 719)
+++ trunk/LedgerSMB/locales.pl 2006-12-05 04:53:13 UTC (rev 720)
@@ -110,7 +110,7 @@
}
}
- 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 @@
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 @@
# 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 @@
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 @@
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);
Modified: trunk/bin/admin.pl
===================================================================
--- trunk/bin/admin.pl 2006-12-05 04:21:13 UTC (rev 719)
+++ trunk/bin/admin.pl 2006-12-05 04:53:13 UTC (rev 720)
@@ -589,12 +589,12 @@
# access control
- open(FH, $menufile) or $form->error(__FILE__.':'.__LINE__.': '."$menufile : $!");
+ open(FH, '<', $menufile) or $form->error(__FILE__.':'.__LINE__.': '."$menufile : $!");
# scan for first menu level
@a = <FH>;
close(FH);
- if (open(FH, "custom_$menufile")) {
+ if (open(FH, '<', "custom_$menufile")) {
push @a, <FH>;
}
@@ -801,10 +801,10 @@
foreach $file (@templates) {
- open(TEMP, "${LedgerSMB::Sysconfig::templates}/$file") or $form->error(__FILE__.':'.__LINE__.': '."$templates/$file : $!");
+ open(TEMP, '<', "${LedgerSMB::Sysconfig::templates}/$file") or $form->error(__FILE__.':'.__LINE__.': '."$templates/$file : $!");
$file =~ s/$form->{mastertemplates}-//;
- open(NEW, ">$form->{templates}/$file") or $form->error(__FILE__.':'.__LINE__.': '."$form->{templates}/$file : $!");
+ open(NEW, '>', "$form->{templates}/$file") or $form->error(__FILE__.':'.__LINE__.': '."$form->{templates}/$file : $!");
while ($line = <TEMP>) {
print NEW $line;
@@ -1297,7 +1297,7 @@
sub lock_system {
# This needs to be done with a db tool
- #open(FH, ">${LedgerSMB::Sysconfig::userspath}/nologin") or $form->error($locale->text('Cannot create Lock!'));
+ #open(FH, '>', "${LedgerSMB::Sysconfig::userspath}/nologin") or $form->error($locale->text('Cannot create Lock!'));
#close(FH);
$form->{callback} = "$form->{script}?action=list_users&path=$form->{path}";
$form->redirect($locale->text('Lockfile created!'));
Modified: trunk/bin/am.pl
===================================================================
--- trunk/bin/am.pl 2006-12-05 04:21:13 UTC (rev 719)
+++ trunk/bin/am.pl 2006-12-05 04:53:13 UTC (rev 720)
@@ -1407,9 +1407,9 @@
foreach $file (@templates) {
if (-f "$myconfig{templates}/$file") {
- open(TEMP, "$myconfig{templates}/$file") or $form->error("$myconfig{templates}/$file : $!");
+ open(TEMP, '<', "$myconfig{templates}/$file") or $form->error("$myconfig{templates}/$file : $!");
- open(NEW, ">$myconfig{templates}/$form->{code}/$file") or $form->error("$myconfig{templates}/$form->{code}/$file : $!");
+ open(NEW, '>', "$myconfig{templates}/$form->{code}/$file") or $form->error("$myconfig{templates}/$form->{code}/$file : $!");
while ($line = <TEMP>) {
print NEW $line;
Modified: trunk/bin/login.pl
===================================================================
--- trunk/bin/login.pl 2006-12-05 04:21:13 UTC (rev 719)
+++ trunk/bin/login.pl 2006-12-05 04:53:13 UTC (rev 720)
@@ -238,7 +238,7 @@
#this needs to be done via db
#if (! $form->{beenthere}) {
- # open(FH, "${LedgerSMB::Sysconfig::memberfile}") or $form->error(__FILE__.':'.__LINE__.": $memberfile : $!");
+ # open(FH, '<', "${LedgerSMB::Sysconfig::memberfile}") or $form->error(__FILE__.':'.__LINE__.": $memberfile : $!");
# @a = <FH>;
# close(FH);
#
@@ -282,7 +282,7 @@
# upgrade dataset and log in again
#locking needs to be done via db function
- #open FH, ">${LedgerSMB::Sysconfig::userspath}/nologin" or $form->error($!);
+ #open FH, '>', "${LedgerSMB::Sysconfig::userspath}/nologin" or $form->error($!);
for (qw(dbname dbhost dbport dbdriver dbuser dbpasswd)) { $form->{$_} = $user->{$_} }
Modified: trunk/dists/win32/shebang-activeperl.pl
===================================================================
--- trunk/dists/win32/shebang-activeperl.pl 2006-12-05 04:21:13 UTC (rev 719)
+++ trunk/dists/win32/shebang-activeperl.pl 2006-12-05 04:53:13 UTC (rev 720)
@@ -7,7 +7,7 @@
closedir DIR;
foreach $file (@perlfiles) {
- open FH, "+<$file";
+ open FH, '+<', "$file";
@file = <FH>;
Modified: trunk/dists/win32/shebang-vanilla.pl
===================================================================
--- trunk/dists/win32/shebang-vanilla.pl 2006-12-05 04:21:13 UTC (rev 719)
+++ trunk/dists/win32/shebang-vanilla.pl 2006-12-05 04:53:13 UTC (rev 720)
@@ -7,7 +7,7 @@
closedir DIR;
foreach $file (@perlfiles) {
- open FH, "+<$file";
+ open FH, '+<', "$file";
@file = <FH>;
Modified: trunk/import_members.pl
===================================================================
--- trunk/import_members.pl 2006-12-05 04:21:13 UTC (rev 719)
+++ trunk/import_members.pl 2006-12-05 04:53:13 UTC (rev 720)
@@ -50,7 +50,7 @@
my @users = ();
-open(FH, "$membersfile") || die ("Couldn't open members file!");
+open(FH, '<', "$membersfile") || die ("Couldn't open members file!");
while (<FH>) {
Modified: trunk/setup.pl
===================================================================
--- trunk/setup.pl 2006-12-05 04:21:13 UTC (rev 719)
+++ trunk/setup.pl 2006-12-05 04:53:13 UTC (rev 720)
@@ -124,7 +124,7 @@
if (-f "VERSION") {
# get installed version from VERSION file
- open(FH, "VERSION");
+ open(FH, '<', "VERSION");
@a = <FH>;
close(FH);
$version = $a[0];
@@ -429,13 +429,13 @@
&decompress;
if ($newinstall) {
- open(FH, "ledger-smb.conf.default");
+ open(FH, '<', "ledger-smb.conf.default");
@f = <FH>;
close(FH);
unless ($latex) {
grep { s/^\$latex.*/\$latex = 0;/ } @f;
}
- open(FH, ">ledger-smb.conf");
+ open(FH, '>', "ledger-smb.conf");
print FH @f;
close(FH);
@@ -450,12 +450,12 @@
$filename = "ledger-smb-httpd.conf";
# do we have write permission?
- if (!open(FH, ">>$httpddir/$filename")) {
- open(FH, ">$filename");
+ if (!open(FH, '>>', "$httpddir/$filename")) {
+ open(FH, '>', "$filename");
$norw = 1;
}
- open (HTTPD, '< sql-ledger-httpd.conf');
+ open (HTTPD, '<', 'sql-ledger-httpd.conf');
while ($line = <HTTPD>){
print FH $line;
}
@@ -506,7 +506,7 @@
if (!$confd) {
if (!(`grep "^# LedgerSMB" $httpd`)) {
- open(FH, ">>$httpd");
+ open(FH, '>>', "$httpd");
print FH qq|
@@ -618,7 +618,7 @@
sub create_lockfile {
if (-d "$userspath") {
- open(FH, ">$userspath/nologin");
+ open(FH, '>', "$userspath/nologin");
close(FH);
}
Modified: trunk/utils/notify_short/listener.pl
===================================================================
--- trunk/utils/notify_short/listener.pl 2006-12-05 04:21:13 UTC (rev 719)
+++ trunk/utils/notify_short/listener.pl 2006-12-05 04:53:13 UTC (rev 720)
@@ -30,7 +30,7 @@
sleep $cycle_delay;
}
sub on_notify {
- open (MAIL, "| $sendmail");
+ open (MAIL, '|-', "$sendmail");
$sth = $dbh->prepare("
SELECT partnumber, description, onhand, rop FROM parts
WHERE onhand <= rop
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.