Hm, what's the shortest way to do this: I have a hash where one, and only 
one, key begins with a number, I don't know its value and want to assign 
this value to a variable.

If I were to do a foreach loop, I'd do this (presuming that %hash is 
already defined):

foreach my $key(keys %hash) {
        if ($key =~ /^\d/) {push (@keys, $key); }
}

But since I know there will only be one key where this condition is true, 
looping and creating an array seems like a waste.


Birgit Kellner

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to