Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

andye Re: Pasring XML into a simple hash

by andye (Curate)
on Jun 21, 2001 at 15:47 UTC ( #90333=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    while ($text =~  m|<jobnumber>(.*?)</jobnumber>.*?<location>(.*?)</loc
    +ation>|sg) {
            print "Found job number $1 in location $2 \n";
    }
    
  2. or download this
    my $regexp = '<post>';
    $regexp .= "(?=.*?<$_>(.*?)</$_>)" foreach qw(jobnumber location);
    ...
    while ($stuff =~ m|$regexp|sog) {
            print "Found job number $1 in location $2 \n";
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2020-05-28 22:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (166 votes). Check out past polls.

    Notices?