RE: Trapping errors

2006-05-10 Thread Timothy Johnson
y, May 10, 2006 11:20 AM To: Perl Beginners Subject: Trapping errors I am using wmi within Perl and if I get any errors the script will die I don't want to script to die, I want the script to continue. Here is part of my script and if any of these lines has a problem the script dies. How can

Trapping errors

2006-05-10 Thread Gallagher, Tim \(NE\)
I am using wmi within Perl and if I get any errors the script will die I don't want to script to die, I want the script to continue. Here is part of my script and if any of these lines has a problem the script dies. How can I trap the errors and keep the script going? Thanks -T sub GetBIOS {

Re: trapping errors in "use"

2003-01-20 Thread Jeff 'japhy' Pinyan
On Jan 21, Victor Tsang said: >$mod = "CGI"; >unless (eval "use $mod") > { >warn "unable to install $mod $@\n"; > } > } Change your eval() to eval "use $mod; 1;" which forces a true value to be returned if 'use' runs successfully. -- Jeff "japhy" Pinyan [EMAI

Re: trapping errors in "use"

2003-01-20 Thread simran
from 'perldoc -f use' use Module (); That is exactly equivalent to BEGIN { require Module } me thinks, what you want is > #!/usr/bin/perl > BEG

trapping errors in "use"

2003-01-20 Thread Victor Tsang
I have a piece of code which will be used in two different environment, One of the difference of the 2 system is a special library that is avaiable to only one of them. Going into the cookbook I found example 12.2 very suitable for my need. So I created the following code to test the idea #!/usr

Re: Trapping errors from SQL

2002-01-30 Thread Michael Fowler
On Wed, Jan 30, 2002 at 07:37:55PM +, Jonathan E. Paton wrote: > You need to look into the configuration then, since my > logfile > is punctuated with timestamps in the following way: > > [Fri Jan 4 12:15:54 2002] [error] [client 192.168.100.1] > File does not exist: > /usr/local/httpd/htdoc

Re: Trapping errors from SQL

2002-01-30 Thread Scott Taylor
At 11:30 AM 01/30/02, Jason Purdy wrote: >You may also be interested in checking out the RaiseError attribute of any >DBI handle... > >$dsn = 'DBI:mysql:dbname'; # not sure what this looks like for InterBase >$dbh = DBI->connect( $dsn, 'username', 'password' ); >$dbh->{RaiseError} = 1; Thank

Re: Trapping errors from SQL

2002-01-30 Thread Jonathan E. Paton
| > Surely you have the script name and timestamp next to that? | > | | Nope, that's the entire message. | Shame, you have some details but nothing leading to the problem without knowing which script... of many. | > If not, upgrade your httpd to something this side of 1900. | > ;) | | The http

Re: Trapping errors from SQL

2002-01-30 Thread Jason Purdy
You may also be interested in checking out the RaiseError attribute of any DBI handle... $dsn = 'DBI:mysql:dbname'; # not sure what this looks like for InterBase $dbh = DBI->connect( $dsn, 'username', 'password' ); $dbh->{RaiseError} = 1; Jason If memory serves me right, on Wednesday 30 J

Re: Trapping errors from SQL

2002-01-30 Thread Jonathan E. Paton
> Does anyone know how I can trap this error? It's in my > "/var/log/httpd/error_log" file once in a while. > > DBD::InterBase::st execute failed: Overflow occurred > during data type > conversion. > -conversion error from string "" > DBD::InterBase::st fetchrow failed: Unknown cursor > -Dynam

Trapping errors from SQL

2002-01-30 Thread Scott Taylor
Does anyone know how I can trap this error? It's in my "/var/log/httpd/error_log" file once in a while. DBD::InterBase::st execute failed: Overflow occurred during data type conversion. -conversion error from string "" DBD::InterBase::st fetchrow failed: Unknown cursor -Dynamic SQL Error -SQL

Trapping Errors

2001-09-27 Thread Brett Hales
Hello, I have a perl script that inserts rows of data into a table. I wish to trap any errors on this insert and e-mail them to an address. I wish to use the standard mail tool that comes with UNIX. eg echo $trapped_error | mail [EMAIL PROTECTED] A snippit of my script is below. Can anybody