in reply to Re: Help me ! I am stuck ! PERL DBI
in thread Help me ! I am stuck ! PERL DBI

Hi Kyle , 

Exactly ! you are 100 % correct . 
Now it works with "return" instead of exit.
Thanks a lot .


Also Thanks for you review on my coding standard.
1. Actually I will write all warning/error mesg into a log file.
2.ofcourse i will put my   ($staffcode) = @_;  to the top most in the sub.
3. You mean to say that use " sth->fetchrow_array"  instead of  ($sth->fetchrow_array()) ???
4.I will learn abt use strict and let me...


Thanks a lot. 
Suriya

Replies are listed 'Best First'.
Re^3: Help me ! I am stuck ! PERL DBI
by spectre9 (Beadle) on Oct 13, 2007 at 03:56 UTC
    You might wish to get in a habit of checking for $err as well. In some situations, if you $sth->execute fails, and you $sth->fetchrow Perl may (will) exit entirely. Checking for errors is a good habit to get into -- it will prepare you for the 'next database'
    spectre#9 -- more dangerous than acme