my @f = ( 4, 2 ); my @g = sort @f; if( "@f" eq "@g" ){ die "already sorted, can't have that\n" }