Im not really sure how this relates to your thread subject line but anyway...
I think the problem relates to the fact that your regex is:
if ($line =~ /$job/) {
....you are just testing if $line contains $job and so if the job id is:
000123
...and you enter 0 then the match is true. It is also true for 00, 000, 0001, 00012, 000123 so you'll want to split on your database delimiter and then use:
if ($split_field == $job) {
...to do your match.
I think the problem relates to the fact that your regex is:
if ($line =~ /$job/) {
....you are just testing if $line contains $job and so if the job id is:
000123
...and you enter 0 then the match is true. It is also true for 00, 000, 0001, 00012, 000123 so you'll want to split on your database delimiter and then use:
if ($split_field == $job) {
...to do your match.