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

Perl and XML - Reading multiple lines

by scotb (Initiate)
on Jan 11, 2013 at 12:54 UTC ( #1012879=perlquestion: print w/ replies, xml ) Need Help??
scotb has asked for the wisdom of the Perl Monks concerning the following question:

my $price = 0; foreach $line(@entry) { if($line =~ m/titleA/) { $price = 1; next; } if($phone) { print "The phone numbers of Family members are:"; print "$line"; $price= 0; } }

I need to search for multiple elements from the XML when the title is matched. The above brings back the price but what if I want to search for another element in the xml when the title is matched?

appreciate your help!

Comment on Perl and XML - Reading multiple lines
Download Code
Replies are listed 'Best First'.
Re: Perl and XML - Reading multiple lines
by choroba (Canon) on Jan 11, 2013 at 13:06 UTC
    Welcome to the Monastery, scotb.

    Please, format your question accordingly (Markup in the Monastery).

    We cannot help you much if you do not provide a sample of the input data. Use <code> tags for the data, too.

    To process XML, one usually uses some of the modules that really understand it. See XML::LibXML or XML::Twig.

    لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
Re: Perl and XML - Reading multiple lines
by Anonymous Monk on Jan 11, 2013 at 13:18 UTC

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (18)
As of 2015-07-31 15:27 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 (279 votes), past polls