Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

can I get a loop?

by Anonymous Monk
on Feb 05, 2001 at 23:36 UTC ( [id://56480]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: can I get a loop?
by kilinrax (Deacon) on Feb 05, 2001 at 23:40 UTC
    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.
    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: perlquestion [id://56480]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (10)
As of 2024-04-18 15:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found