diparun has asked for the wisdom of the Perl Monks concerning the following question:
#!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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: accessing @$array elements
by gjb (Vicar) on Apr 21, 2004 at 08:18 UTC | |
by ysth (Canon) on Apr 21, 2004 at 09:17 UTC |