HI i have a ".csv" file and i need to sort the content of this file in perl, sorting has to be done based on the column number (for example if i say 4 th column then the contents of the file has to be sorted based on the 4th column )..... could you please help me with it is it possible to sort the contents of any file according to a particular column [:)]

You got the right idea. Note in your algorithm, refer to the fourth column with $col=4. There are variations to save time and/or memory. (e.g. Your temp array could consist of just two columns, the column you wish to sort and either an index or reference into the original array.)

Perl does not have a unix like "column sort" built-in. I have not looked, but I would bet there is a module on CPAN to do what you want. If not, package your sort as module yourself. Good Luck, Bill