Phoenix.pm: Perl OOP

Beaves at aol.com Beaves at aol.com
Fri Apr 16 22:22:03 CDT 1999


I have started to dive into OOP and have started to design a few modules.  It 
would be very interesting for me to chat with others who have dabbled in OOP 
with Perl and who most assuredly have more knowledbe base than I do.

I have two modules that I am currently working on...

LH, which stands for ListHash.  I have often come across situations where you 
want data to behave like a list, but yet also have some of the 
characteristics of a hash.  Its a pretty simple module/object, but it may be 
a good place to discuss design and scope of an object, something I have 
probably been bastardizing all along.  If you would like a TXT file of the 
code, e-mail me. 
LH allows stuff like:  # 'tis but a sample
$lh = LH->new('A', 'B', 'C', 'B');
if ($lh->exists('B'))  # does 'B' exist in this list
$num_Bs = $lh->num('B');  # $num_Bs is 2
$lh->insert_after('C', 'CC')  # $lh->list is now 'A', 'B', 'C', 'CC', 'B');

Comment are welcome and appreciated.



The other is more boring, but I call it 'Atts'.  It's sole purpose is to spit 
out a list of 'legal' attributes for a given HTML tag.  Sounds simple enough, 
but I have been tinkering with the best interface to allow modification of 
the attribute list, as well as attempts to make the program more efficient.  
(That may be another topic for the Phoenix.pm group on another day).  I have 
found a need for this in my current project of a database Table maker.  I'm 
still working on 'Atts', so I don't want it released just yet.

If anyone has questions about either project, then please feel free to 
contact me.

Tim Beavers
Former greenskeeper turned pro...





More information about the Phoenix-pm mailing list