The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



Thread: help with perl
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 05-16-2008
meghana meghana is offline
Registered User
 

Join Date: Feb 2008
Posts: 56
Smile

Quote:
Originally Posted by era View Post
Code:
if (m%<cd>(.*?)</cd>%) { $stuff = $1 }
... provided the start and end tags are always on the same line. If there can be multiple occurrences on the same line, you need to add a loop and a /g flag, too.
Thanks era, yes they are always in the same line. Can you please explain me what exactly is it doing?
as far as my understanding goes - (.*?) this is fetching the all the values in between the tags .. what does the m% do? and is $1 output from the if condition?
if (m%<cd>(.*?)</cd>%) { $stuff = $1 }

thanks again for you quick reply
Reply With Quote