#!perl "d:\Perl\bin\perl.exe" require 'subroutines.lib'; use strict; use warnings; use SQL::Parser; my $sql = <STDIN>; 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 RESULTI +NG 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";
20040421 Edit by Corion: Added code tags
In reply to accessing @$array elements by diparun
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |