#!/usr/bin/perl -lw use strict; my ($a, $b) = (7, 5); ($b, $a) = ($a, $b); print join ' ', sort { $a <=> $b } qw( 5 28 1 ); print "$b $a";