#!perl "d:\Perl\bin\perl.exe" require 'subroutines.lib'; use strict; use warnings; use SQL::Parser; my $sql = ; my $parser = SQL::Parser->new; my $success = $parser->parse( $sql ); die $parser->errstr unless $success; my $structure = $parser->structure; my $command = $structure->{command}; my $tables = $structure->{org_table_names}; my $columns = $structure->{org_column_names}; my $where_cols = $structure->{where_cols}; if ($success) { # DISPLAY RESULTING DATA use Data::Dumper; # STRUCTURE print Dumper $parser->structure; } if ($command eq "CREATE"){ &createfile(@$tables); } #elsif{ # #} print "Command : $command\n"; print "Tables : @$tables\n"; print "Columns : @$columns\n"; print "where : $where_cols\n";