[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: : Hi all, : : I have little formatting problem, we have code: : : sub test { : $sth = $dbh->prepare_cached(<<SQL); : INSERT INTO table (ip, port, type, create_date) : VALUES (?,?,?,?) : SQL : $sth->execute('12.12.12.12', 80, proxy, '2002-12-12'); : $sth->finish; : return; : }
Don't use a HERE doc and pass $dbh into the subroutine. sub test { my $dbh = shift; my $sth = $dbh->prepare_cached( q( INSERT INTO table( ip, port, type, create_date ) VALUES (?,?,?,?) ) ); $sth->execute( '12.12.12.12', 80, 'proxy', '2002-12-12' ); $sth->finish; return; } HTH, Charles K. Clarkson -- Mobile Homes Specialist 254 968-8328 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>