Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re^3: Relational table with perl DBI

by poj (Parson)
on Mar 14, 2013 at 10:43 UTC ( #1023455=note: print w/ replies, xml ) Need Help??

in reply to Re^2: Relational table with perl DBI
in thread Relational table with perl DBI

It looks to me like this code has the potential to give you the same event more than once in the event table each with a different id.
if ($_ =~ /=E-(.*)=event/){ $event = $1; push @event_prepare, $event; }
It would be much simpler to forget using numerical keys and just use the $event itself as the primary key. Use a hash to eliminate duplicates like this ;
if ($_ =~ /=E-(.*)=event/){ $event_prepare{$1} = 1; }
With regard to the article table, I would use the n value from the filename outputcondord.n.txt as the primary key thus avoiding sorting and synchronising problems as well as making the data in the table more human readable. Your article_event_index would then just need to contain the n value from the filename and the text from the events in that file.

Comment on Re^3: Relational table with perl DBI
Select or Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1023455]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2016-05-31 02:17 GMT
Find Nodes?
    Voting Booth?