Rajesh Dorairajan wrote:
I've to extract a CN (Common Name) from an LDAP DN. The LDAP DN is
as shown below:
isuer=CN=Name,OU=People,OU=com
I just need to extract the Name from the above string. Right now
I've
my @tmpList = split ( /=CN=/, $_ );
$issuer = $tmpList[1];
But this returns the whole string "Name,OU=People,OU=com"
You'd better use a regex without the split() function:
my ($issuer) = /CN=([^,]+)/;
Suggested reading:
http://www.perldoc.com/perl5.8.4/pod/perlrequick.html
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>