Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: How do I get only one item out of attribute?

by imp (Priest)
on Aug 21, 2006 at 16:28 UTC ( #568599=note: print w/replies, xml ) Need Help??

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',
    );
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://568599]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2021-05-09 12:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (100 votes). Check out past polls.

    Notices?