Thanks owens for the response
This code is included in our testing infrastructure to extract some data.
Please find the code included in the perl module :
print SCRIPT "${d}${driver} ${d}${driver}_OPTIONS ${d}DATA_MODE_FLAG
${d}\{CTI_OPT_SIGN\}O${d}OPT_LEVEL -c \$INCLUDE $srcfile \$EXTRA_ARGS 1>
${d}ERRFILE
1 2> ${d}ERRFILE2 \n";
print SCRIPT "RET=${d}\?\n";
print SCRIPT "cat ${d}ERRFILE1 ${d}ERRFILE2 >> ${d}ERRFILE\n";
print SCRIPT "${tooldir}/rm -f ${d}ERRFILE1 ${d}ERRFILE2\n";
my $ctck = envVarIsTrue("CT_CHECK_EXIT");
if ($failtag eq "CompileErr") {
open my $pipe, "-|", "/usr/atria/bin/cleartool", "desc",
$include_path/$srcfile or die "could not run cleartool: $!";
{
my @matches;
while (<$pipe>) {
next unless /created/;
my @rec = split;
print "\n";
print split (/-/, $rec[1]);
push @matches, substr $rec[1], 0, 9; }
$days1 = epoch_days('30-Apr-09');
$days2 = epoch_days('14-May-09');
$day = $days2 - $days1;
if ($day < 15)
{
$failtag = "TestcaseDiff";
}
BEGIN {
my %month_num = do {
my $n = 0;
map(($_, $n++), qw/jan feb mar apr may jun jul aug sep oct nov dec/);
};
sub epoch_days {
my @dmy = split /-/, shift;
$dmy[1] = $month_num{lc $dmy[1]} || 0;
return timelocal(0, 0, 0, @dmy) / (24 * 60 * 60);
}
}
}
}
Below is the error with the line no.
meaningless input.
Uncaught exception from user code:
Illegal division by zero at
/CLO/Tests/CTI/Scripts/drivers/lib/regressionDriver.pm line 371.
-Rajini
Below is the error with line no. and required details :
On Fri, Jun 5, 2009 at 6:58 PM, Chas. Owens <[email protected]> wrote:
> On Fri, Jun 5, 2009 at 07:37, Rajini Naidu <[email protected]> wrote:
> > Hi,
> >
> > This is my code in perl.
> >
> > my $include = "foo.1";
> > my $ct = "/usr/atria/bin/cleartool";
> >
> > open my $pipe, "-|", $ct, "desc", $include or die "could not run
> cleartool:
> > $!";
> >
> > When i execute this , I am getting below error.
> >
> > meaningless input.
> >
> > Uncaught exception from user code:
> > Illegal division by zero.
> >
> > Is there any other way to represent below code in perl,
> >
> > open my $pipe, "-|", $ct, "desc", $include or die "could not run
> cleartool:
> > $!";
> >
> > Am i missing anything here. Please advise.
> >
> > -Rajini
> >
>
> You should not get that error from the code you posted. Please post a
> small (less than twenty lines) version of your code that produces this
> problem. Also, errors in Perl normally come with the line number
> where they were found (which is not exactly the same thing as where
> the error is), so this may be a cleartool error. Does the cleartool
> command work when you run it from the commandline?
>
>
> --
> Chas. Owens
> wonkden.net
> The most important skill a programmer can have is the ability to read.
>