I'm pretty sure you need to avoid matching the start of the 2nd tag, otherwise text of the form:
<solar>abcde</solar><solar>fghij</solar> Will be extracted as: abcde</solar><solar>fghij E.g. Use a character class that avoids matching the start of a tag: $solar_info =~ s!<solar>([^<]*)</solar>!$1!g; -- Matthew Bassett <hewb...@gmail.com> Sorry about the top posting- am replying from my phone. -----Original Message----- From: Matt Wheeler Sent: 12/07/2010 23:46:32 Subject: Re: [ubuntu-uk] [OT] Quick Perl question... [some pruned text] You could remove both the start and end tags with something like $solar_info =~ s!<solar>(.*)</solar>!$1!; (note I'm also using ! instead of / so I don't have to escape the /) -- Matt Wheeler m...@funkyhat.org -- ubuntu-uk@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk https://wiki.ubuntu.com/UKTeam/ -- ubuntu-uk@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk https://wiki.ubuntu.com/UKTeam/