in reply to Re: Type of arg 1 to shift must be array (not sort)
in thread Type of arg 1 to shift must be array (not sort)
BUT not what OP wanted .. he wants @array to contain N-1 values at the end.. Something like (though not the most efficent):perl -le '@x=(9,8,4,3,6,5); print ((sort @x)[0])'
perl -le '@x=(9,8,4,3,6,5); print join ":", ((sort @x)[1..$#x])' # OP: @array = sort @array; shift @array; #using above: @array = ((sort @array)[1..$#array])
|
|---|