I'd like to do the following in Perl:
my @triples=([3,4,5],[5,12,13],[8,5,17],[7,24,25]};
Then I want to select one of the four triples at random, then assign the elements of the selection to the variables x, y, and r.
For example, if [3,4,5] is selected at random, assign x= 3, y = 4, r =5.
Any suggestions?
my ($x, $y, $r) = @{$triplets[int(rand 4)]}like this?