#!/usr/bin/perl -wT use strict; { local $, = ', '; my @sorted_args = sort @ARGV; print @sorted_args; } print "\nBack to normal: ", @ARGV, "\n"; { local $" = '-'; my @sorted_args = sort @ARGV; print "@sorted_args"; } print "\nBack to normal: @ARGV\n"; =OUTPUT % ./sortedargs.pl c a b a, b, c Back to normal: cab a-b-c Back to normal: c a b