2 Qs XML(loosly) and reinventing the wheel

Todd Caine todd_caine at eli.net
Thu Feb 14 16:02:47 CST 2002

Good afternoon.

E Jwrote:

> First question:
> Does anyone know the location of a variety of examples from simple to
> complex of Perl parsing XML?

I don't know of any one place that has a set of examples organized in the
fashion that your looking for but here are some good URLs that might be of


I've been doing a some work recently with Perl and XML.  I needed to be able
to take a Juniper router configuration file which was stored as a very large
XML document and generate db files for the DNS with A, PTR, and CNAME
records.  I used XML::XPath to pluck out very specific interface information
that I wanted.  I found XML::XPath to be very easy to use (assuming you are
familiar with XPATH) for plucking data of XML files.

> Second Question:
> When is it reinventing the wheel?
> Ok...I downloaded a few Perl apps (message boards) to compare.  Some I
> like better than others, but none of them *did* it for me.  (btw, a lot
> of them look almost exactly alike)  So, there's this one that *looks*
> good, but under that hood it's practically disgusting.

As far as applications written in Perl go I wouldn't be overly concerned
with reinventing the wheel.  If you don't like the way it's done or the
features it supports by all means rewrite the darn thing.  There are a lot
of apps out there that should just be recoded from the ground up after some
proper planning is done.  I think reinventing the wheel is talking more
about generic peices of functionality such as a module, component or a
class.  For example if you were going to write a CGI script it would
probably be a waste of time to not use CGI.pm.  I don't think that rewriting
a CGI script is neccessarily reinventing a wheel.

> Should I wade through more forum apps trying to find another one I like,
> or should I continue to
> play with the code?

This is really your call.  In my opinion, if you see something close to what
you want it would probably be better to start a dialogue with the author,
find out where the project is heading, see if they need some help, and if
they are willing to listen give them suggestions on how it could be improved
(patches never hurt either ;).  If they aren't willing to work with you or
listen to any of your suggestions then it's time to move on either looking
for another application with simular features or start planning your own.

> btw.  The licence is Free, but I do want to notify the author before
> putting it up anywhere "public".

I would recommend giving your code back to the maintainer of the application
so that you can improve on an existing application rather than clutter the
net with yet another forum app.

> remind me not to post before 11am ever ever again, as there's a decided
> lack of coffee running through my system.  thnx again.

Hey Elizabeth, don't post before 11 am ever again.  8'P  Just kidding, these
are good questions.

just my $0.02,


More information about the Pdx-pm-list mailing list