in reply to Generating 2 unique random integers (So I can't pop a list...)

...which can be simplified to
use List::Util 'shuffle'; my ($r1, $r2) = shuffle(1..10);

No need for intermediary storage.

Update: This was meant to be a reply to BrowserUk, whose node originally ended before the quoted text.

  • Comment on Re: Generating 2 unique random integers (So I can't pop a list...)
  • Download Code