Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Reading a particular values from the file.

by murugu (Curate)
on Nov 23, 2005 at 14:29 UTC ( [id://511105]=note: print w/replies, xml ) Need Help??


in reply to Reading a particular values from the file.

Hi anushya,

Best way to handle XML is to use XML modules such as XML::Simple, XML::Twig, etc.....

Here is the code which will do what you need....

use strict; use warnings; my $data=<DATA>;#As only one line in the file... my @member_nos = $data=~m/<member_id>(\d+)/g; print join $/,@member_nos; __DATA__ <member_id>60</member_id><a>a</a><b>b</b><member_id>74</member_id><mem +ber_id>83</member_id>

Regards,
Murugesan Kandasamy
use perl for(;;);

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-04-26 03:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found