I would like to sort very large size file around 5-10GB size. However using Perl Sort command, script get executed for very long time & get aborted due to out of memory issue. Hence, my assumption is it should store intermediate temporary files at the same directory. So, storing these temporary files some other location may resolve this issue. So, just checking if we can specify temporary directory location in sort command like unix.
Perl's default sort routine is an in memory sort routine. The OS sort program is a file-based sort routine that can handle larger data sets. If you want Perl to do the same as the unix sort program, you will need to implement it your self (my comment above), or find someone else's implementation and use it (BrowserUK's suggestion above). There are no temp files used by the out-of-the-box sort routine in Perl.