I just found this in 'perldoc -f open':

    Though if you try to re-open "STDOUT" or "STDERR" as an "in
    memory" file, you have to close it first:

        close STDOUT;
        open STDOUT, '>', \$variable or die "Can't open STDOUT: $!";

So try closing STDOUT first before opening it for append.

HTH.

Hardy Merrill

>>> Laurie Vien <[EMAIL PROTECTED]> 03/24/04 02:44PM >>>
I am running a very simple Perl script using DBI (skeleton of it
follows).
It does everything I expect it to, but the problem is it doesn't
finish
until I Ctrl-C, at which time I get the message "Terminating on signal
SIGINT(2)".  What have I left out or done in the wrong order that
causes it
not to terminate?:

#MyPerlScript.pl
use DBI;
use Date::Manip;

$dbh = DBI->connect($DB_CONN, $DB_USER, $DB_PASS) || die "Can't
connect:
$dbi::errstr";
open(STDOUT, ">>myfile.txt") or die "\nCould not open STDOUT: $!";

$sth = $dbh->prepare("SELECT * FROM MyTable");  
$sth->execute();

# < Do bunches of stuff here ....>
#
#

$sth->finish();
$dbh->disconnect();
close(STDOUT);

Laurie

Reply via email to