Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: can I get a loop?

by kilinrax (Deacon)
on Feb 05, 2001 at 23:40 UTC ( #56484=note: print w/replies, xml ) Need Help??


in reply to can I get a loop?

Assuming you have a hash ('%usernames') of the usernames already taken:
my $username; foreach (@usernames) { if (!exists $usernames{$_}) { $username = $_; last; } }
After which, '$username' will either contain the first unused username from '@usernames', or be undefined, if none were available.

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://56484]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (2)
As of 2022-05-25 04:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (84 votes). Check out past polls.

    Notices?