By the way, do yourself a favor and install Data::Dumper and then use it as
follows:
use Data::Dumper;
...
my @results = $mySQL->runQuery("Select A,B from tablename;");
...
print Dumper(\...@results);
Data::Dumper will do its best to dump everything that's contained in the ref
passed to it. That'll make it much easier for you to access the content
correctly. It's one of the first modules I install along with a new perl
installation :-)
Tobias
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Mark
Leighton
Sent: Wednesday, November 18, 2009 3:45 PM
To: [email protected]
Subject: Re: Displaying Hash key/values if you don't know what they are
From what I see here, $rows is a hash reference, therefore:
use strict;
use warnings;
my $mySQL = SQLfunctions->new;
$mySQL->createSQLConnection("localhost\\Company", "Import");
my @results = $mySQL->runQuery("Select A,B from tablename;");
foreach my $row ( @results ) {
foreach my $column ( keys %{$row} ) {
printf "%s: %s\n", $column, $row->{$column};
}
}
Sorry, don't have Win32::SqlServer on a box so the code is untested.
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs