#!/usr/bin/perl use strict; @a = qw(z x c v b n m); # make a little array sort @a; # sorts @a but result discarded! print "@a\n"; # thus @a not sorted here. Here's why: print sort @a; # prints the sorted @a array print "\n@a\n"; # damn, still not stored sorted though! @a = sort @a; # assigns sorted result to @a print "@a\n"; # as @a now contains sorted result... # this works!