in reply to sorting the column of array element
Notice how the second parameter of sort is enclosed in curly-brackets. That’s because it is actually an executable subroutine or block, which is obliged to return a value that is less, greater, or equal to zero. Although operators such as <=> are helpfully provided for your convenience, the comparison function can actually be anything that it needs to be. This is how you can, for example, do multi-level sorts (more than one key), or sort on particular elements of an array, object, or hash.
Particularly if you perform the same sort the same way in more than one place in your program, seriously consider defining a single sub that you can write just one time and then reference many times throughout your program.