in reply to Execute statement based on version.
I would send different statements to MySQL, based on the MySQL version.
my ($major,$minor) = get_my_sql_version(); my $statement; if ($major < 5) { $statement = 'show variables'; } elsif ("$major.$minor" eq "5.0") { $statement = 'show global variables'; } elsif ("$major.$minor" gt "5.0") { $statement = 'Select * from information_schema.global_variables or +der by 1'; }; $dbh->execute($statement); ...
The implementation of get_my_sql_version() is left as an exercise to the reader. As literature, I recommend get mysql version.
|
|---|