Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: (nrd) When does XML get to be too much?

by newrisedesigns (Curate)
on Jan 24, 2003 at 21:22 UTC ( #229714=note: print w/ replies, xml ) Need Help??


in reply to Re: When does XML get to be too much?
in thread When does XML get to be too much?

I know XML is a buzzword nowadays, and that's part of the reason I used it: practice. However, after I was done, I realized that it was probably a mistake.

As for DBI... I don't know it. I read Dominus' article on using DBI, and I found it interesting, but I didn't grasp it right away. I will probably switch over to DBI and mySQL once I learn that.

I was originally going to use a DB_File (Any_DBM, actually) database, but as far as I know, they don't allow for HoHs. If one does, I'd switch the program over. Any recommendations?

John J Reiser
newrisedesigns.com


Comment on Re^2: (nrd) When does XML get to be too much?
Re: Re^2: (nrd) When does XML get to be too much?
by gjb (Vicar) on Jan 24, 2003 at 21:44 UTC

    I've never used it myself, but you could have a go at MLDBM, it should do what you want.

    Hope this helps, -gjb-

Re: Re^2: (nrd) When does XML get to be too much?
by sauoq (Abbot) on Jan 24, 2003 at 21:59 UTC
    I was originally going to use a DB_File (Any_DBM, actually) database, but as far as I know, they don't allow for HoHs.

    Although, as gjb suggested, you can use MLDBM or you can use Data::Dumper or Storable to serialize your data structure by hand, the truth is that you don't even need an HoH in your case. You are storing the same data for each IP: visits and a timestamp. I would just store the two values in a single scalar delimited by a non-digit character of your choosing. (Consider using a comma, space, colon, semicolon, or pipe symbol as they are all commonly used for this kind of thing.) The right rule of thumb to follow in this case is "keep it simple."

    -sauoq
    "My two cents aren't worth a dime.";
    
(jeffa) 3Re: When does XML get to be too much?
by jeffa (Chancellor) on Jan 25, 2003 at 15:30 UTC
    Wha wha what?!?!?! You haven't learned DBI yet? Unshift that item to the front of your queue and start reading! ;)

    Seriously, DBI and an RDBM can take a programmer to a new level of programming. I recommend any programmer out there who doesn't know how to program with a database learn how to do so very soon. The DBI part is not hard, but setting up and maintaining an RDBM can be. Luckily, there is the wonderful SQLite and the even more wonderful DBD::SQLite that allows you to use SQLite in Perl. One of the greatest benefits of using SQLite is that you get to use SQL, and if you use DBI with DBD::SQLite, then when the time comes to migrate to a "real" RDBM, all you should have to do is simply replace use DBD::SQLite with use DBD::mysql or use DBD::Pg.

    Do yourself a big favor and take some time out to learn these tools.

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (9)
As of 2014-07-29 23:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (229 votes), past polls