in reply to Re: Re: converting hash to shuffled array
in thread converting hash to shuffled array

Why is there a my $pair? I only see it being used in that one statement.

Um! Cos I made a mistake! It should be @pair and now is:)

Why is there a @pair at the end when the previous line is giving it a value?

The previous line loops a random number of time setting the @pair to succesive key/value pairs from the hash.

Once the loop stops, the last statement becomes the return value for the do block, and so the last key/value pair assigned to the array @pair, get assigned to the variables $name and $url.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller
If I understand your problem, I can solve it! Of course, the same can be said for you.

  • Comment on Re: Re: Re: converting hash to shuffled array