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
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
{
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
from 'perldoc -f use'
use Module ();
That is exactly equivalent to
BEGIN { require Module }
me thinks, what you want is
> #!/usr/bin/perl
> BEG
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
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
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
| > 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
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
> 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
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
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
12 matches
Mail list logo