in reply to Array Element Deletion

I'll put it this way then. I have a hash whereby it has a key for each date in a range. Each date could have multiple people assigned. So I might have a hash entry like this :
$hash{"DEC012008"}[0] = "Mike"; $hash{"DEC012008"}[1] = "Steve"; etc..,
I want to randomly select one of the elements in the array assigned to the hash entry DEC012008 and then remove it from that array so, if I come back to that date, I don't reselect a person that was already selected.

Replies are listed 'Best First'.
Re^2: Array Element Deletion
by Krambambuli (Curate) on Dec 07, 2008 at 08:36 UTC
    It always pays to take a look onto when searching for a solution. It looks to me that Tie::Pick is exacly what you want.

    As for the list reference you might need, it's no crime to dereference it explicitely in order to use simpler structures , like say
    my $candidates_ref = $hash{"DEC012008"};
    Hth

    Krambambuli
    ---