@lines = ; shuffle(@lines); print OUT @lines; # or if 'shuffle' returns the shuffled list print OUT shuffle(); #### ($lines[param('from')], $lines[param('to')]) = ($lines[param('to')], $lines[param('from')]);