[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [719] branches/1.2



Revision: 719
          http://svn.sourceforge.net/ledger-smb/?rev=719&view=rev
Author:   tetragon
Date:     2006-12-04 20:21:13 -0800 (Mon, 04 Dec 2006)

Log Message:
-----------
Converting 2-arg open to 3-arg open

Modified Paths:
--------------
    branches/1.2/LedgerSMB/AM.pm
    branches/1.2/LedgerSMB/BP.pm
    branches/1.2/LedgerSMB/Form.pm
    branches/1.2/LedgerSMB/Inifile.pm
    branches/1.2/LedgerSMB/User.pm
    branches/1.2/LedgerSMB/locales.pl
    branches/1.2/bin/admin.pl
    branches/1.2/bin/am.pl
    branches/1.2/bin/login.pl
    branches/1.2/dists/win32/shebang-activeperl.pl
    branches/1.2/dists/win32/shebang-vanilla.pl
    branches/1.2/import_members.pl
    branches/1.2/setup.pl
    branches/1.2/utils/notify_short/listener.pl

Modified: branches/1.2/LedgerSMB/AM.pm
===================================================================
--- branches/1.2/LedgerSMB/AM.pm	2006-12-05 03:18:44 UTC (rev 718)
+++ branches/1.2/LedgerSMB/AM.pm	2006-12-05 04:21:13 UTC (rev 719)
@@ -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;
@@ -1606,9 +1606,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
 
@@ -1649,7 +1649,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: branches/1.2/LedgerSMB/BP.pm
===================================================================
--- branches/1.2/LedgerSMB/BP.pm	2006-12-05 03:18:44 UTC (rev 718)
+++ branches/1.2/LedgerSMB/BP.pm	2006-12-05 04:21:13 UTC (rev 719)
@@ -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: branches/1.2/LedgerSMB/Form.pm
===================================================================
--- branches/1.2/LedgerSMB/Form.pm	2006-12-05 03:18:44 UTC (rev 718)
+++ branches/1.2/LedgerSMB/Form.pm	2006-12-05 04:21:13 UTC (rev 719)
@@ -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 {
@@ -584,9 +584,9 @@
 	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 {
@@ -607,11 +607,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 : $!");
@@ -793,7 +793,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");
@@ -897,7 +897,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");
@@ -927,7 +927,7 @@
 
 			$self->{OUT} = $out;
 
-			unless (open(IN, $self->{tmpfile})) {
+			unless (open(IN, '<', $self->{tmpfile})) {
 				$err = $!;
 				$self->cleanup;
 				$self->error("$self->{tmpfile} : $err");
@@ -942,7 +942,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");
@@ -1122,7 +1122,7 @@
 	my @err = ();
 
 	if (-f "$self->{errfile}") {
-		open(FH, "$self->{errfile}");
+		open(FH, '<', "$self->{errfile}");
 		@err = <FH>;
 		close(FH);
 	}
@@ -1147,7 +1147,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: branches/1.2/LedgerSMB/Inifile.pm
===================================================================
--- branches/1.2/LedgerSMB/Inifile.pm	2006-12-05 03:18:44 UTC (rev 718)
+++ branches/1.2/LedgerSMB/Inifile.pm	2006-12-05 04:21:13 UTC (rev 719)
@@ -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: branches/1.2/LedgerSMB/User.pm
===================================================================
--- branches/1.2/LedgerSMB/User.pm	2006-12-05 03:18:44 UTC (rev 718)
+++ branches/1.2/LedgerSMB/User.pm	2006-12-05 04:21:13 UTC (rev 719)
@@ -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: branches/1.2/LedgerSMB/locales.pl
===================================================================
--- branches/1.2/LedgerSMB/locales.pl	2006-12-05 03:18:44 UTC (rev 718)
+++ branches/1.2/LedgerSMB/locales.pl	2006-12-05 04:21:13 UTC (rev 719)
@@ -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: branches/1.2/bin/admin.pl
===================================================================
--- branches/1.2/bin/admin.pl	2006-12-05 03:18:44 UTC (rev 718)
+++ branches/1.2/bin/admin.pl	2006-12-05 04:21:13 UTC (rev 719)
@@ -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&amp;path=$form->{path}";
 	$form->redirect($locale->text('Lockfile created!'));

Modified: branches/1.2/bin/am.pl
===================================================================
--- branches/1.2/bin/am.pl	2006-12-05 03:18:44 UTC (rev 718)
+++ branches/1.2/bin/am.pl	2006-12-05 04:21:13 UTC (rev 719)
@@ -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: branches/1.2/bin/login.pl
===================================================================
--- branches/1.2/bin/login.pl	2006-12-05 03:18:44 UTC (rev 718)
+++ branches/1.2/bin/login.pl	2006-12-05 04:21:13 UTC (rev 719)
@@ -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: branches/1.2/dists/win32/shebang-activeperl.pl
===================================================================
--- branches/1.2/dists/win32/shebang-activeperl.pl	2006-12-05 03:18:44 UTC (rev 718)
+++ branches/1.2/dists/win32/shebang-activeperl.pl	2006-12-05 04:21:13 UTC (rev 719)
@@ -7,7 +7,7 @@
   closedir DIR;
 
   foreach $file (@perlfiles) {
-    open FH, "+<$file";
+    open FH, '+<', "$file";
     
     @file = <FH>;
 

Modified: branches/1.2/dists/win32/shebang-vanilla.pl
===================================================================
--- branches/1.2/dists/win32/shebang-vanilla.pl	2006-12-05 03:18:44 UTC (rev 718)
+++ branches/1.2/dists/win32/shebang-vanilla.pl	2006-12-05 04:21:13 UTC (rev 719)
@@ -7,7 +7,7 @@
   closedir DIR;
 
   foreach $file (@perlfiles) {
-    open FH, "+<$file";
+    open FH, '+<', "$file";
     
     @file = <FH>;
 

Modified: branches/1.2/import_members.pl
===================================================================
--- branches/1.2/import_members.pl	2006-12-05 03:18:44 UTC (rev 718)
+++ branches/1.2/import_members.pl	2006-12-05 04:21:13 UTC (rev 719)
@@ -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: branches/1.2/setup.pl
===================================================================
--- branches/1.2/setup.pl	2006-12-05 03:18:44 UTC (rev 718)
+++ branches/1.2/setup.pl	2006-12-05 04:21:13 UTC (rev 719)
@@ -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: branches/1.2/utils/notify_short/listener.pl
===================================================================
--- branches/1.2/utils/notify_short/listener.pl	2006-12-05 03:18:44 UTC (rev 718)
+++ branches/1.2/utils/notify_short/listener.pl	2006-12-05 04:21:13 UTC (rev 719)
@@ -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.