Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

redhotpenguin's scratchpad

by redhotpenguin (Deacon)
on Jul 09, 2004 at 16:17 UTC ( [id://373187]=scratchpad: print w/replies, xml ) Need Help??

#!/usr/bin/env/perl use strict; use warnings; use XML::Parser::Expat; use Data::Dumper qw(Dumper); my $parser = XML::Parser::ExpatNB->new(); my $done; $parser->setHandlers('Start' => \&sh, 'End' => \&eh, 'Char' => \&ch); foreach my $snippet qw( < bro ke nx ml> con tent < /bro kenxm l> ) { print "Waiting for an event...\n"; $parser->parse_more($snippet); } sub sh { print "A start element: ", Dumper($_[1]), "\n"; } sub eh { print "An end element: ", Dumper($_[1]), "\n"; } sub ch { print "Some Data: ", Dumper($_[1]), "\n"; } 1;
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-09-20 03:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The PerlMonks site front end has:





    Results (25 votes). Check out past polls.

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.