in reply to Newbie Needs Help with Hash
You can utilize regexes for the task. The following is a recommendation.
Oguzuse warnings; use strict; my $user_name_regex = qr/ ~ # match the first ~ ([^~]+) # capture the characters as long as it is not a ~ /x; my $smartcard_id_regex = qr/ ~ # match the first ~ ([^~@]+) # capture the characters as long as it is not a ~ or @ /x; @getuser = `dsquery user –name * -o samid –limit 1000`; my @user_names = map { chomp; $_ =~ $user_name_regex; # match and capture user name $1 # return the capture; } @getuser; @getcert = `dsquery usern –name * -o upn –limit 1000`; my @smartcard_ids = map { chomp; $_ =~ $smartcard_id_regex; # match and capture smartcard id $1; # return the capture } @getcert;
---------------------------------
life is ...
$mutation = sub { $_[0] =~ s/(.)/rand()<0.1?1-$1:$1/ge };
|
|---|