note
suaveant
There are ways to do this but it is generally considered bad practice to do so unless you have no other choice. Consider instead an array.
<C>
$lines[0] = "use pricedb";
$lines[1] = "second statement";
for my $sql (@lines) {
$dbh->do($sql);
# check code here
}
</C>
That easily lends itself to pulling queries from a file or building queries programmatically. It also means you can have an arbitrary number of lines. I highly suggest getting <BR>
[http://www.amazon.com/Learning-Perl-Randal-L-Schwartz/dp/1449303587|Learning Perl]<BR>
And/Or<BR>
[http://www.amazon.com/Programming-Perl-Unmatched-processing-scripting/dp/0596004923|The Camel Book]<BR>
If you are going to be doing any amount of Perl programming, both are very useful. Of course there are lots of online tutorials, too.
<P>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-56739">
<P> - Ant<BR>
- Some of my
best work - (<A HREF="/index.pl?node_id=85541">1</a> <A HREF="/index.pl?node_id=470390">2</a> <A HREF="/index.pl?node_id=116759">3</a>)<BR>
</div></div>
984630
984630