SQL::Dialects::ANSI is a simple interface to information about ANSI SQL in INI format. So you get that and parse it... except its not in INI format because it doesn't contain key = value
but just key
which chokes Config::INI. Alas, this is one of the few INI parsers I could find that will deal with a string.
So you might have to parse it by hand. That's what SQL::Parser does.
Alternatively you can pull the list out of SQL::Parser's guts.
use Data::Dumper;
use SQL::Parser;
my $s = SQL::Parser->new;
print Dumper $s->{opts}{reserved_words};
This is a hack and will eventually fail.
As per my comments above, the list of ANSI SQL reserved words (hey, which version of ANSI SQL?) is not definitive. The database itself may reserve additional words. And different versions may reserve different words. If you can find a way to do whatever it is you're doing that doesn't rely on a list of reserved words, do that.