I have an issue that is driving me mad because I really think it's absurd.. What horribly obvious thing am I missing here?
this is a little snippet of code:
use XBase;
use strict;
my $table = new XBase $filename or die XBase->errstr;
my $cursor = $table->prepare_select("ID", "NAME", "STREET");
while (my @data = $cursor->fetch) {
### do something here, like print "@data\n";
}
obviously this simple code has a specific function: a connection is made and data is retrieved.. Everything runs fine..
..but if I try to pass the fields list as the content of a string, as in the snippet below, something goes wrong and no data is retrieved:
use XBase;
use strict;
my $test = '"ID", "NAME", "STREET"';
my $table = new XBase $filename or die XBase->errstr;
my $cursor = $table->prepare_select($test);
while (my @data = $cursor->fetch) {
### do something here, like print "@data\n";
}
it seems that prepare_select() does not like at all a list of fields contained inside a string.. ..but probably I'm missing the usual horribly obvious thing..! ;)
Cris