Help for this page

Select Code to Download


  1. or download this
    my $dn = 'corpid=xxxxxx,ou=people,o=corp';
    my ($ou) = $dn =~ /ou=([^,]*)/;
    print "ou = $ou\n";
    
  2. or download this
    my $dn = 'corpid=xxxxxx,ou=people,o=corp';
    my %tokens = map {split /=/} split /,/, $dn;
    print "ou = $tokens{ou}\n";
    
  3. or download this
    my %tokens = (
      corpid => 'xxxxxx',
      ou => 'people',
      o => 'corp',
    );