M
mikeybe
OK. I'm having a bear of a time with this. I think the best way to
present this is to describe the data set and then ask someone to help
me figure out HOW to organize the data.
I am writing a program to pull out data from a pipe delimited file that
has library book information (it's a new book list generated from our
library catalog) like this:
isbn|dewey decimal number|title|author
I know how to read the file and break the elements apart etc. The goal
of the program is to create RSS feeds by dewey number. So, an RSS feed
will have books from 000-100, another 100-200 etc. so people can
subscribe to the new books feed by subject. I am making this list
dynamic so I can alter the list and the program will still work. Like
this:
my @deweystring= qw / 000_100 100_200 200_300 300_400 400_500 500_600
600_700 /;
Using that deweystring list, The program will create the rss files
named the same as the elements of that list (ie "000_100.rss") and
populate them with the correct lines of data. I know how to make the
RSS files (xml::rss etc.).
SO...
I am trying to make a data structure to fit properly and can't get the
syntax right:
I want to make a array of a hashes but the array needs to be named from
that list...so, make an array named @000_100 (I know arrays can't start
with numbers...ideas?) that has a hash with keys "Title" "author"
"ISBN" etc.
So I want to make arrays named after the elements found in the
deweystring list (which everyone says should be done with hashes, and
not variable names) and populate the array with hashes of the data
found in the pipe delimited file....and then get the data back out.
I'll spare you from my code so far since this is a pretty straight
forward question...Can someone write some generic code that would do
something like that? I would REALLY appreciate a little guidance.
Thanks,
Mike
present this is to describe the data set and then ask someone to help
me figure out HOW to organize the data.
I am writing a program to pull out data from a pipe delimited file that
has library book information (it's a new book list generated from our
library catalog) like this:
isbn|dewey decimal number|title|author
I know how to read the file and break the elements apart etc. The goal
of the program is to create RSS feeds by dewey number. So, an RSS feed
will have books from 000-100, another 100-200 etc. so people can
subscribe to the new books feed by subject. I am making this list
dynamic so I can alter the list and the program will still work. Like
this:
my @deweystring= qw / 000_100 100_200 200_300 300_400 400_500 500_600
600_700 /;
Using that deweystring list, The program will create the rss files
named the same as the elements of that list (ie "000_100.rss") and
populate them with the correct lines of data. I know how to make the
RSS files (xml::rss etc.).
SO...
I am trying to make a data structure to fit properly and can't get the
syntax right:
I want to make a array of a hashes but the array needs to be named from
that list...so, make an array named @000_100 (I know arrays can't start
with numbers...ideas?) that has a hash with keys "Title" "author"
"ISBN" etc.
So I want to make arrays named after the elements found in the
deweystring list (which everyone says should be done with hashes, and
not variable names) and populate the array with hashes of the data
found in the pipe delimited file....and then get the data back out.
I'll spare you from my code so far since this is a pretty straight
forward question...Can someone write some generic code that would do
something like that? I would REALLY appreciate a little guidance.
Thanks,
Mike