For "a single (and first) dn", use a scalar (not array) and exit the loop once you get it:
my $dn; while (<FILE>) { next unless /(<CN=.*?>)/; $dn = $1; last; }
In reply to Re: Understanding this regex
by hbm
in thread Understanding this regex
by BradV
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |