bobinyec has asked for the wisdom of the Perl Monks concerning the following question:

I have a script file called fred.pl. When fred exits with an error, a log file called fred.log is created. How can I stop that? Here's fred.pl:

#! /bin/perl use strict; use SCMTools::Util; my ($report, $util); my $release_name = $ARGV[0]; my $Retcode = 0; $util = SCMTools::Util->new(); $report = $util->runcmd("Report -general ReleaseView -select name -whe +re \"name = '$release_name' \""); chomp($report); if ($report ne $release_name) { print " fred.pl: Error. There is no release $release_name.\n"; $Retcode = 16; } exit($Retcode);

Replies are listed 'Best First'.
Re: Log File
by ricDeez (Scribe) on Jan 04, 2012 at 23:17 UTC

    Your code as posted is not doing that directly, but it may be worthwhile checking whether this is a feature of the SCMTools::Util module that you are importing. I couldn't find it on CPAN so I am guessing this is something that you guys must have developed in-house.

Re: Log File
by ~~David~~ (Hermit) on Jan 04, 2012 at 21:09 UTC
    Perl is not doing that... I am guessing you are redirecting the output on error? Maybe try returning undef instead of $Retcode on error? How is this script being executed, manually?

      Another possibility is that the SCMTools::Util module is outputting to a log file when it encounters an error. Difficult to tell without see the code of that module.