N. Ganesh Babu <[EMAIL PROTECTED]> wrote:
> Dear All,
> 
>  <lt=c24>PRL IJB PRL CHA <refauth><fname>K.</fname>  
> <middlename>M.</middlename> 
[...]

I'm having a bad case of deja vu with this...

>  How to backtrack the below pairs of information from the above line. 
>  the number of pairs/line may chage from  a range of 1 to 5

I'd say parsing with XML::Parser could help you getting
the data into a manageable shape, although I'd suggest
you fix the markup first:

#!/usr/bin/perl -w

use strict;
use XML::Parser;
use Data::Dumper;

my $xml = '<bibliography chapter="24"><publication short="PRL" title="Phys.
Rev. Lett." volume="71" pages="65" year="1993"><author fname="K."
middle="M." surname="Cuomo" /><author fname="A." middle="V."
surname="Oppenheim" /></publication></bibliography>';

my $p = new XML::Parser(Style => 'Tree');

print Dumper $p->parse($xml);

__END__

HTH,
Thomas

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to