Nope, Ctrl-D doesn't do it; I just tried that.

-----Original Message-----
From: Vonnahme, Nathan [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 24, 2004 2:53 PM
To: Laurie Vien; [EMAIL PROTECTED]
Subject: RE: Why won't my script terminate?



Can you terminate with Ctrl-D ?  Usually when I get that sort of effect
the script is waiting for some input on STDIN and I haven't given it
any.  If Ctrl-D ("end of file") stops it, that's probably your problem.


Another thing to try might be to not use STDOUT as your filehandle name,
that might clarify what's going on...

open(MYOUT, ">>foo.txt") or die "couldn't open foo.txt for appending";
print MYOUT "blah blah";
close MYOUT;


> -----Original Message-----
> From: Laurie Vien [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, March 24, 2004 10:44 AM
> To: '[EMAIL PROTECTED]'
> Subject: Why won't my script terminate?
> 
> 
> 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