So to simplify lets ignore the database for now and say you have - a bug id, a committers name and an array containing the bug id, a code and a list of developers involved in the code
I assume that you don't want someone who is not assigned the bug committing the code but the reverse is just as easy.
#!/usr/bin/perl -w
use strict;
my $bug_no = shift;
my $committer = shift;
my @array =("16410 88 bhorwat, dpotte1, jbehr, lgrimes",
"16412 88 pputta1",
"16413 88 gkothi, aandy");
my %hash;
foreach(@array){
#remove those commas
s/,//g;
#get your bug id and a list of devs
my ($bug_id,undef,@dev) = split/\s+/,$_;
foreach(@dev){
#dont really need data in the hash only the key
$hash{$bug_id}{$_} = $_;
}
}
#this can be a loop if you have many bugs and committer combos
if(!defined($hash{$bug_no}{$committer})){
print "Committer $committer is not assigned to Bug $bug_no";
}
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.