IPC::Open3 issue


R

Rocky Allen

Hey Y'all,

Get random weird error trying to load IPC::Open3. Dont really know where
else to turn, cant find it on google. Anyone seen it before?


ERROR:
IPC::Open3 version 54 required--this is only version 1.0106 at
/usr/lib/perl5/5.8.7/Exporter/Heavy.pm line 121

the required version number goes higher each time I execute the script.

CODE:
#!/usr/bin/perl

use strict;
use warnings;
use Sys::Hostname;
use IPC::Open3

my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
localtime(time);
my $actyear = $year + 1900;
my $actmon = $mon + 1;
if ($mon < 10) {$actmon = "0" ."$actmon";};
if ($min < 10) {$min = "0" ."$min";};
if ($sec < 10) {$sec = "0" ."$sec";};
if ($mday < 10) {$mday = "0" ."$mday";};
if ($hour < 10) {$hour = "0" ."$hour";};
my $error ;
my @errors;
my($wtr, $rdr, $err);
# Variables. This section will need to be modified for each Cooperative.

my $host = hostname;
my $backupdir = '/backup/scripts/files';
my $jobstart = localtime();
my $fileformat = "contents-" . "$actyear" . "-" . "$actmon" . "-" .
"$mday" . "_" . "$hour" . ":" . "$min" . ":" . "$sec";
my $largefiles = '/tmp/largefiles';
my $contentsfile = "/etc/backup/$fileformat";

system("cd $backupdir ; find . -follow -size +2000000k -print >
$largefiles");
push @errors, "could not open Filehandle to get large files: $?\n" if
defined($error);
print "I made it here\n";A
 
Ad

Advertisements

J

Joe Smith

Rocky said:
ERROR:
IPC::Open3 version 54 required--this is only version 1.0106 at
/usr/lib/perl5/5.8.7/Exporter/Heavy.pm line 121

the required version number goes higher each time I execute the script.

use Sys::Hostname;
use IPC::Open3
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =

Those two lines are the equivalent of
use IPC::Open3 43;
where the number changes every second.
You have a missing semicolon.
if ($mon < 10) {$actmon = "0" ."$actmon";};
if ($min < 10) {$min = "0" ."$min";};
if ($sec < 10) {$sec = "0" ."$sec";};
if ($mday < 10) {$mday = "0" ."$mday";};
if ($hour < 10) {$hour = "0" ."$hour";};

Yuck!

my $hhmmss = sprintf "%02d:%02d:%02d",$hour,$min,$sec;
my $yyyyddmm = sprintf "%04d-%02d-%02d",$year+1900,$mon+1,$day;
my $fileformat = $yyyyddmm . "_$hhmmss";

-Joe
 
Ad

Advertisements

R

Rocky Allen

Those two lines are the equivalent of
use IPC::Open3 43;
where the number changes every second.
You have a missing semicolon.


Yuck!

my $hhmmss = sprintf "%02d:%02d:%02d",$hour,$min,$sec;
my $yyyyddmm = sprintf "%04d-%02d-%02d",$year+1900,$mon+1,$day;
my $fileformat = $yyyyddmm . "_$hhmmss";

-Joe

Thank you so much. I cannot believe how foolish that was. I knew there
must be an easier way to get the date printed, but couldnt find an obvious
method using perdoc -q time.
Thanks again
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top