in reply to Re^2: Help Needed
in thread Help Needed

Of course your value of CA will change, otherwise you wouldn't have to extract it! But what will be the general pattern between dn and CA? Is it always ': ou=' or something different?

But in any case, with the solution I posted, I think you now know how to do it...

-- 
Ronald Fischer <ynnor@mm.st>

Replies are listed 'Best First'.
Re^4: Help Needed
by scott_apc (Initiate) on Feb 03, 2009 at 12:57 UTC
    Thanks, I am able to get it, but I dont get the results where I have "CA-ABC", instaed of "CA",

      Which regexp did you use to parse the value? You didn't tell us yet the syntax for the string after the '=' sign.

      -- 
      Ronald Fischer <ynnor@mm.st>
        Thanks Ronald, I have customised it further and using split command to get the value: if(/\bdn:(.*)/) { $value=$1; @val = split (/,/, $value); print "$val[0]"; last; This gives me what I need. Original Value: dn: ou=Sample-Collaboration, ou=assets, o=abc.com Expected Value: ou=Sample-Collaboration is there any other way around to get it?