The time now is 09/05/08 - 00:57
Log in: Username: Password:
Search forums for:
  

I need some perl help

Post new topic   Reply to topic
Author Message
gotissues68
RealPoor Sensei
RealPoor Sensei


Joined: 21 Aug 2003
Posts: 1866



PostPosted: 05/01/05 - 03:19    Post subject: I need some perl help Reply with quote

Anyone willing to help me out with some perl via chat? I've got a script I'm trying to hack up that a friend of mine wrote. Unfortunately alot of things have changed since he wrote it and he's not able to help me fix it at the moment...
Back to top
Occulis
RealPoor Jedi
RealPoor Jedi


Joined: 11 Oct 2002
Posts: 13293
Location: Moral Relativity Central



PostPosted: 05/01/05 - 07:58    Post subject: Reply with quote

paste it here d00d and i'll look!
Back to top
Occulis
RealPoor Jedi
RealPoor Jedi


Joined: 11 Oct 2002
Posts: 13293
Location: Moral Relativity Central



PostPosted: 05/01/05 - 07:58    Post subject: Reply with quote

i mean here!
Back to top
khrath
RealPoor Master of Posts
RealPoor Master of Posts


Joined: 11 Oct 2002
Posts: 8750



PostPosted: 05/01/05 - 09:11    Post subject: Reply with quote

http://www.rafb.net/paste/results/Sinvmm48.txt
Back to top
gotissues68
RealPoor Sensei
RealPoor Sensei


Joined: 21 Aug 2003
Posts: 1866



PostPosted: 05/01/05 - 16:02    Post subject: Reply with quote

hey Dunn here it is http://www.rafb.net/paste/results/SfRrVR80.html

Here's what I'm trying to change...

foreach $record (keys %DATA) {
for $what (@{$DATA{$record}}) {
print OUTPUT "INSERT INTO techiekb_com VALUES('','$what->{domain}','$what->{ttl}','$what->{rdtype}','$what->{rdata}');\n";
}
}
print OUTPUT "\n\n";

close(OUTPUT);


The database schema has changed since the script was written. it wouldn't matter, I could get it working with just changing up the number of fields, however certain fields are contained for just certain records in the new schema, for instance a record has xxx and mx has xxx or whatever.

thanks for looking, perl isn't my strong suit =\ I'm trying to learn though



Let me explain myself better.
the original database schema was storing data in only 4 fields....

domain, ttl, rdtype, rdata

now there is 11 fields, but not each record needs to all fields to be field. So I guess my bigger question (I was thinking about this while I was driving to my folks) was how can I basically loop through a file looking for specific record types, fill in the appropriate schema fields and then move onto the next record type until none is left and exit? I tried a while loop which makes sense ... but it was an endless loop ...
Back to top
gotissues68
RealPoor Sensei
RealPoor Sensei


Joined: 21 Aug 2003
Posts: 1866



PostPosted: 05/02/05 - 10:51    Post subject: Reply with quote

nevermind I figured it out on my own =) I was confused on how to work with some hash arrays.. but it makes complete sense now ..
Back to top
Display posts from previous:   
Post new topic   Reply to topic
Page 1 of 1

Related topics: