"Jeff Thies" <> wrote in message
news:...
> James E Keenan wrote:
> > If so, then how you get the data *into* the hash depends mostly on the
data
> > source. If the data were true HTML rather than "pseudo-HTML,"
>
> It's generated by something like this:
>
> http://thelimit.com/cgi-bin/commonsense_edit.pl
>
> That'll require IE5 or NS6 or a DOM2 browser to make sense of the
> javascript.
>
> Each of those "blocks" is an object.
>
An object in the sense of Perl objects (sets of data with methods attached)?
If so, what class are they members of? Or object just in the sense of a
data record (or field therein)?
> So I need to store the object data for each block and the background
> data for the whole page.
With a certain degree of care it is possible to use a hash to include both.
For example, if you took Bob Walton's suggestion for forming the hash keys
....
$h{block1,paragraph,text}='something';
$h{block2,paragraph,text}='something borrowed';
$h{block3,paragraph,text}='something blue';
.... you then might have a special key which held the background data:
$h{'background'} = [ # an array of background characteristics];
This would require you, when writing accessor methods or subs to exclude
this key from loops:
foreach (keys %h) {
unless ($h{'background'}) {
... # process keys holding data
}
}
>
> I started off storing this in a config file with a bunch of crazily
> named scalars. Then I switched to a simple hash.
>
> It seems to me that this should probably be stored as xml.
Depending on the scale of your project and whether your data set will
ultimately have to interact with other data sets.
>
> I'm coming a bit late to writing object orientated perl and I get
> pretty confused at times!
>
For assistance, you already have:
perldoc perlobj
perldoc perlboot
perldoc perltoot
And you can get Randal Schwartz's new book "Perl Objects, References and
Modules" and/or Damian Conway's "Object Oriented Perl."
jimk