>>>>> "paul" == paul 0403 <[EMAIL PROTECTED]> writes:

paul> Is there a quick and easy way in perl to get the last entry in a file
paul> for a specific value

paul> For example If I have the following data in a file

paul> <len>1<\len>
paul> <type>int<\type>
paul> <len>2<\len>
paul> <type>int<\type>
paul> <len>3<\len>
paul> <type>int<\type>

paul> I would like to get the line <len>3<\len>.

paul> Please keep in mind that the data in the file is only a sample and it
paul> will not alwasy be the second line from the bottome :-)

You haven't stated the problem sufficiently.  How come it isn't

  <type>int<\type>

What does "last entry for a specific value" mean?  To me, that's
the last entry in the file. :)  What does "specific" mean, specifically?

By the way, is this some bizarro mirror XML, or do you really mean
  <type>int</type>
?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

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


Reply via email to