Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

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

by ambrus (Abbot)
on Jun 05, 2005 at 09:15 UTC ( [id://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
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (9)
As of 2024-04-19 07:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found