in reply to Re^3: Repeat question (redo)
in thread Repeat question

This is perfectly OK, but the temporary variable is not really needed and this can be simplified as follows:
($random_integer1, $random_integer2) = ($random_integer2, $random_inte +ger1) if $random_integer1 < $random_integer2;

Replies are listed 'Best First'.
Re^5: Repeat question (redo)
by pryrt (Abbot) on Nov 30, 2018 at 19:00 UTC

    that was exactly one the "more perlish ways" I was referencing. I would have done it that way for myself, but I thought the explicit swap was more concrete for the OP to understand what was going on.

      Yeah, I guess I missed the last sentence of your previous post when I first read it. I might not have reacted if I had seen it.

      Still, I think it was useful to show this other way of swapping values without using a temporary variable.