Paul Harwood wrote:
> What would be the best method to parse the following DN? I just want
> the first part of this DN so I can create a server list into an array
> (EX-MSG-01, EXMSG-02 etc). I've tried using SPLIT but I am not sure
> how to get the first part of the text I want. Any help appreciated.
>
> CN=EX-MSG-01,CN=Servers,CN=foreignlocation,CN=Administrative
> Groups,CN=domain,CN=Microsoft
> Exchange,CN=Services,CN=Configuration,DC=company,DC=domain,DC=com

Hi.

If you want to use split, this will work:

    my $DN =
'CN=EX-MSG-01,CN=Servers,CN=foreignlocation,CN=Administr...';

    my ($server) = split ',', $DN;          # 'CN=EX-MSG-01'
    (undef, $server) = split '=', $server;  # 'EX-MSG-01'

HTH,

Rob








-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to