Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Do not reinvent the wheel: real-world example using XML::Twig

by ambrus (Abbot)
on Jun 05, 2005 at 09:15 UTC ( #463681=perlmeditation: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use warnings;
    use strict;
    ...
                                                                          
    +          
    {
                                                                          
    +          
    
  2. or download this
    # REIMPLEMENTING THE WHEEL STARTS HERE
    
    ...
            $handler{"Char"} = sub { $string .= $_[1]; };
                                                                          
    +          
    # REIMPLEMENTING THE WHEEL ENDS HERE (more or less)
    
  3. or download this
            my($child, $member, $goodness, $id);
            $starthandler{"cluster"} = sub {
    ...
                    sub { push @$member, $string; };
            };
                                                                          
    +          
    
  4. or download this
            XML::Parser->new("Handlers", \%handler)->parsefile($ARGV[0]);
    
  5. or download this
            warn "done parsing xml";
                                                                          
    +          
    ...
                                                                          
    +          
    # ... and here we actually do something with what we'we read, but I wo
    +n't show that ...
    
  6. or download this
    use warnings;
    use strict;
    ...
                                                                          
    +          
    # ... and I omit the rest of the code again ...
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://463681]
Approved by bart
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2015-07-05 12:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (66 votes), past polls