Script stops execution because you have not handled the case where
> connect() fails.
>
yes, you are correct.

>
> Use:
> my $dbh = DBI->connect(...) or mysendmail("Cannot connect to DB: " .
> DBI->errstr);
>
I use die in the case of the failure of a statement, never thought about the
construct mentioned above.


>
> It's good programming practice to always check the return values of your
> system and function calls.
>
yes very valid point.

>
>
> If you are running this script through cron/at then be truly lazy (it's one
> of
> the virtues of a perl programmer right?) and don't bother with sendmail at
> all.
> Any output on stderr will be automatically emailed by cron/at to the
> configured
> email address.  Just use the regular warn/die calls in Perl and cron/at
> will
> automatically take care of emailing them to your user.
>
:),  learned a new feature of cron.

Thanks Raja, thanks again.



-- 
Ravi Jaya

Mobile: +91 97909 16181
_______________________________________________
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc

Reply via email to