in reply to vanishing system call

No one seems to have suggested looking at the STDERR output. You might want to try:

system("sort -t\\| +1 -2 $file >$file.out 2>/tmp/errors");

Another possibility is that you have so many filenames you've exceeded your shell's maximum command length. A bit unlikely I suspect (specially at only 30 - unless they have very long pathnames).

I'll also put my 'pedant' hat on and point out that you're not making a 'system call', but a call to Perl's system function. These are two very different things.