in reply to Testing numeric strings

Another approach might be to read in all the used numbers before selecting a new one. You would need to optimize things here, but create a list of unused nums from your list of used nums, then randomly select a num from the unused list:
use warnings; use strict; use Acme::Tools qw(minus); use List::Util qw(shuffle); my @alls = 0 .. 9; my @useds = qw(1 2 5 8); # from your aj.db my @unuseds = shuffle(minus(\@alls, \@useds)); my $new_num = $unuseds[0];

Replies are listed 'Best First'.
Re^2: Testing numeric strings
by jlwoodruff (Initiate) on Jul 20, 2011 at 18:58 UTC
    There is other data in the file aj.db that has to be sorted through. This database file looks similar to this:
    1000000163|Jim|Tue Jul 19 14:06:09 2011 1000000066|Kris|Tue Jul 19 14:28:46 2011

    This file is created after submitting the data through forms on html pages. It's all CGI script driven. The numbers need to be parsed out for checking by code that is embedded in the CGI script that is the actual script where the data is entered into the forms.