|
Posted by Jürgen Exner on March 18, 2008, 9:01 pm
Please log in for more thread options
>Hi,
>
>I get a "called too early to check prototype at" in my script and i have no
>idea what this is referring to.It is pointing to this line:
>for(my $count = 0; $count < scalar(@dbset); $count++)
This can be rewritten in a much easier to read way as
for my $count (0..@dbset-1)
>for(my $count = 0; $count < scalar(@dbset); $count++){
> my $myDBI = 'DBI:mysql:' . $dbset[$count] . ':localhost';
> my $dbh = DBI->connect($myDBI,'root','novax')
> or die "Couldn't connect to database: " . DBI->errstr . "\n";
However, as you don't do anything with $count but to index the array in a
linear fashion it is even easier to use a simple
for(@dbset){
my $myDBI = "DBI:mysql:$_ :localhost";
....
jue
|