Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: DVD Profiler...

by DigitalKitty (Parson)
on Jan 12, 2005 at 04:59 UTC ( #421508=note: print w/replies, xml ) Need Help??


in reply to DVD Profiler...

Hi wrboyce.

Storing your DVD information in an XML file would be perfectly fine but if you were / are considering another avenue of exploration, I would suggest a hash of hashes ( HoH ).

#!/usr/bin/perl -w use strict; %DVDs = ( 'Reservoir Dogs: Special Edition' => { 'EAN' => '060049145457', 'director'=> 'Quentin Tarantino', 'year' => '1992', 'region' => 2, 'encoding' => 'PAL', 'aspect ' => '16:9', 'anamorphic' => 0, 'widescreen' => 1, 'audio' => 'Dolby Digital 5.1', 'length' => 94, 'cert' => 18, 'rating' => 5, }, 'C programmers: A documentary' => { 'EAN' => '060049189573', 'director'=> 'Ken Thompson', 'year' => '1996', 'region' => 2, 'encoding' => 'PAL', 'aspect ' => '18:2', 'anamorphic' => 1, 'widescreen' => 1, 'audio' => 'Dolby Digital 5.1', 'length' => 122, 'cert' => 16, 'rating' => 4, }, 'The History of Pascal' => { 'EAN' => '060054789573', 'director'=> 'Niklaus Wirth', 'year' => '1996', 'region' => 2, 'encoding' => 'PAL', 'aspect ' => '16:2', 'anamorphic' => 1, 'widescreen' => 1, 'audio' => 'Dolby Digital 5.1', 'length' => 175, 'cert' => 16, 'rating' => 4, }, );

Since perl permits 'autovivication', creating new key / value pairs is exceptionally easy. Should my idea of using a HoH not appeal to you, I don't see where using your current solution could be deemed a hindrance. If your project required storing a large quantity of data, you might consider using an RDBMS (Relational Database Management System) such as PostgreSQL or MySQL (either of which has distinct advantages and disadvantages). I don't have any experience using postgresql (yet) but I can recommend a good book for learning MySQL:
  • Title: MySQL: The Complete Reference
  • Author: Vikram Vaswani
  • Publisher: Osborne/McGraw Hill
  • ISBN: 0-07-222477-0
  • Retail Price: $39.99

as well as a useful site for related tutorials:

Hope this helps,
~Katie

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://421508]
help
Chatterbox?
[Corion]: This has the dual use of easily requesting sequential URLs and also being suitable for testing
[Corion]: For testing, I want to skip all tests with the same value(s) once one test fails to cut down on the number of failing tests
[Corion]: choroba: Yes, in a way I
[Corion]: ... I'm treating the incoming value sets as bags... Maybe I'll just put the burden on the user, at least in the first attempt at a full API. generate( headers => [{ 'Content-Type' => 'text/plain' }, {'Content-Type' => 'text/json' ] ), even ...
[Corion]: ... if that is cumbersome for the caller to specify. On the other hand, maybe there isn't that big a need for permuting the header values

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2017-01-17 08:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (152 votes). Check out past polls.