[interchange] Change deprecated POSIX::tmpnam to File::Temp versions

David Christensen interchange-cvs at icdevgroup.org
Tue Oct 24 22:05:28 UTC 2017


commit 727711961959b238a72caf6668690069eec11b4d
Author: David Christensen <david at endpoint.com>
Date:   Tue Oct 24 17:04:35 2017 -0500

    Change deprecated POSIX::tmpnam to File::Temp versions

 code/UI_Tag/substitute_file.coretag |    3 ++-
 lib/Vend/External.pm                |    3 ++-
 scripts/crontab.PL                  |    2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/code/UI_Tag/substitute_file.coretag b/code/UI_Tag/substitute_file.coretag
index 5760131..e014703 100644
--- a/code/UI_Tag/substitute_file.coretag
+++ b/code/UI_Tag/substitute_file.coretag
@@ -19,6 +19,7 @@ package File::Copy;
 require File::Basename;
 import File::Basename 'basename';
 package Vend::Interpolate;
+require File::Temp;
 sub {
 	my ($file, $opt, $replace) = @_;
 	my $die = sub {
@@ -49,7 +50,7 @@ sub {
 		return $die->("missing begin or end marker");
 	}
 
-	my $bak = POSIX::tmpnam();
+	my $bak = File::Temp::tmpnam();
 	File::Copy::copy($file, $bak)
 		or return $die->(
 					"substitute_file - %s: unable to backup to %s",
diff --git a/lib/Vend/External.pm b/lib/Vend/External.pm
index eaf1b84..e533b3a 100644
--- a/lib/Vend/External.pm
+++ b/lib/Vend/External.pm
@@ -41,6 +41,7 @@ use Vend::Session;
 use Vend::Cart;
 use Cwd;
 require Data::Dumper;
+require File::Temp;
 
 BEGIN {
 	if($ENV{EXT_INTERCHANGE_DIR}) {
@@ -58,7 +59,7 @@ sub check_html {
 		logError("Can't check HTML: No global CheckHTML defined. Contact admin.", '');
 	}
 
-	my $file = POSIX::tmpnam();
+	my $file = File::Temp::tmpnam();
 	open(CHECK, "|$Global::CheckHTML > $file 2>&1")	or die "Couldn't fork: $!\n";
 	print CHECK $$out;
 	close CHECK;
diff --git a/scripts/crontab.PL b/scripts/crontab.PL
index c5007c2..306664b 100644
--- a/scripts/crontab.PL
+++ b/scripts/crontab.PL
@@ -45,7 +45,7 @@ BEGIN {
 
 ### END CONFIGURATION VARIABLES
 
-use POSIX qw/tmpnam/;
+use File::Temp qw/:POSIX/;
 use Vend::Cron;
 
 my $prospect = tmpnam();



More information about the interchange-cvs mailing list