hi all.
need some expertise once again. i'm trying to use this module i found on cpan:
http://search.cpan.org/~metzzo/XML-RDB-1.1/RDB.pm
its supposed to convert an xml file or shema into an sql schema using mysql or postgresql.
i've tried it a couple of times but i keep getting the following error:
Illegal primary key: >'id'; at /usr/local/share/perl/5.8.7/DBIx/DBSchema/Table.pm line 288.
i've had a look at the relevant line in 'Table.pm' which looks like:
sub primary_key {
my($self,$value)=@_;
if ( defined($value) ) {
$self->{primary_key} = $value;
} else {
#$self->{primary_key};
#hmm. maybe should untaint the entire structure when it comes off disk
# cause if you don't trust that, ?
$self->{primary_key} =~ /^(w*)$/ # this is problem line 288!
#aah!
or die \"Illegal primary key: \", $self->{primary_key};
$1;
}
}
bearing in mind that i have not altered any of this file and have followed their instructions (at least i think i have!) i don't quite understand why i get such an error. :|
does anyone mind having a look? am i being silly again? do you know any other means to accomplish such a task? it would shave weeks off my project & allow me to do more interesting stuff.
i'll attach my script ('xml_rdb.pl' - which is more or less the same as on cpan). i recommend you download the perl module (XML::RDB) from cpan, and see if u get the same error.
as usuall i much appreciate your help! :mrgreen:
thanks
nelo




News Feed
Two years later and the Perl module is still broken!
I also had trouble installing this using CPAN...
Anyway, my question is this, Why does this module need to contact the database if all I want to do is generate the schema?
Also tab delimited files of data would be fine (great actually) - seems a shame to force the fancy DBI stuff.