You are checking that @t1 has not been emptied, but you are forgetting to check whether @t2 is empty. For example:
shift @{ ( !@t2 or ( rand() < .5) && @t1 ) ? \@t1 : \@t2 }
print "Just another Perl ${\(trickster and hacker)},"
The Sidhekin proves Sidhe did it!
In reply to Re: Stable mixing of 2 arrays into a 3rd
by Sidhekin
in thread Stable mixing of 2 arrays into a 3rd
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |