in reply to can I get a loop?
Assuming you have a hash ('%usernames') of the usernames already taken:
After which, '$username' will either contain the first unused username from '@usernames', or be undefined, if none were available.my $username; foreach (@usernames) { if (!exists $usernames{$_}) { $username = $_; last; } }
In Section
Seekers of Perl Wisdom