The code could be tidied up a little but it looks like it should work. It isn't checking anything that might already be in the table, however, just the set of data you are currently inserting, is that intentional?
Some tips:
You can replace:
while ($count<=@IDnumber) {
if ($match == $IDnumber[$count]){
goto NEXTLINE1;
}
$count++;
}
with:
next if(grep {$_ eq $match} @IDnumber);
and you don't really need the label/goto, the command 'next' does exactly that, ie jump back to the top of the loop and start the next iteration.
As to the IDs, first, you should probably check the current values in the table, to see if the one you want to insert is present, assuming there are any. But a much easier way to do this would be to make the field in the table unique ('no duplicates', in Access), in which case it will simply refuse to insert that line, and you can carry on to the next.
C.
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.