Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

total noob question about xml parsing

by kgovert007 (Novice)
on Oct 25, 2014 at 14:59 UTC ( [id://1104971]=perlquestion: print w/replies, xml ) Need Help??

kgovert007 has asked for the wisdom of the Perl Monks concerning the following question:

I am throwing myself at the mercy of the monks! I am seriously time-locked. I am just starting to learn Perl (old java programmer), but have just barely broken the seal on my "Perl in 24 hours" book. I am trying to figure out the simplest (not fastest or most efficient, just most maintainable) way to parse/manipulate some xml files. Here's the problem: I am working on a closed system that is locked down to perl-5.00503. Can anyone at least point me down the right path? I don't need an actual solution, (I wouldn't reject one, either -- I'm not stupid...) but I don't want to start off doing something that may have bad side-effects down the road.

Thanks in advance to anyone who takes pity on me.

Replies are listed 'Best First'.
Re: total noob question about xml parsing
by Laurent_R (Canon) on Oct 25, 2014 at 16:57 UTC
    I appreciate that you said you cannot install CPAN modules, but you could at the very least use some of the pure-Perl XML parsing modules (even copying and pasting the code into your program, if worse comes to worse).

    You could try this: XML::Parser::Lite::Tree or this: http://www.kawa.net/works/perl/treepp/treepp-e.html (but you might have to solve manually some dependencies on your very old version of Perl). They certainly don't have all the bells and whistles of full-fledged heavy-weight Dom or Sax XML parsers, but they may possibly get you out of trouble.

      Thanks! I will try to see if this is possible.
Re: total noob question about xml parsing
by wjw (Priest) on Oct 26, 2014 at 00:59 UTC

    Maybe I missed it, but I don't see you saying what you DO have. Have you checked what modules are installed? Perhaps you might get lucky and find that the distro or whatever source of that locked down Perl has something useful.

    Some ways to do that

    Just a thought...

    ...the majority is always wrong, and always the last to know about it...

    Insanity: Doing the same thing over and over again and expecting different results...

    A solution is nothing more than a clearly stated problem...otherwise, the problem is not a problem, it is simply an inconvenient fact

      So, I don't have anything that starts with XML::

      In the end, I just did the thing I said I was going to do -- parse each line the same way I would have done in C. I appreciate the suggestions you guys gave me, and this assignment has really made me want to get good at perl. I am hoping to start looking into learning it from the start -- the RIGHT way. Of course I am going to peruse through here a lot, I imagine, but do you guys have any text/website reccomendations aside from here and the camel book from O'Reilly?

      Thanks again!!!
Re: total noob question about xml parsing
by duelafn (Parson) on Oct 25, 2014 at 15:18 UTC

    There are many XML modules on CPAN (XML), but it can be hard to find the "right one" since search results are alphabetical rather than by rating/number of reviews. I recommend XML-LibXML.

    Good Day,
        Dean

      Thanks, Dean, but I cannot use anything that is not already part of the default perl-500503 baseline. CPAN is out of the equation.

Re: total noob question about xml parsing
by perlron (Pilgrim) on Oct 25, 2014 at 15:20 UTC
    There might not be a simple approach . If u are doing this for a customer u can be assured that there will be lot of complexities. If its a POC then Ok. I think you should buy more time, as a total new guy and xml parsing in perl might not be a great idea that too with a quick timeline. I mean if ure a whiz, i guess it doesnt matter. Besides, monks generally prefer us to do our homework before we post. google, perlmaven metacpan etc etc.
    Do not wait to strike when the iron is hot! Make it hot by striking - WB Yeats

      Yeah, I am trying to balance family and work this whole weekend, and I'm trying to search for anything I can through google, but most of those results are saying to use XML::Parser, but I don't have that available to use due to a relentless IAM. (HIPAA requirements and such) I am trying to get a quick workaround done while the "true" implementation of a fix to the problem makes its way through the multiple tubes of "process"....

      I will go see if I can find anything on those two resources you mentioned. Thanks!!
        try reading perldoc perldata/pervar and perlreftut before u do anything to see if u are getting a hang of things. for any perl command u want to quickly check eg : sort perldoc -f sort.
        Do not wait to strike when the iron is hot! Make it hot by striking - WB Yeats

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1104971]
Approved by Athanasius
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-03-29 15:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found