in reply to Re: sort system call problem with activestate perl
in thread sort system call problem with activestate perl

To elaborate a bit more: Windows handles `pwd` as a literal. Since it can't create a file in the directory `pwd` (because it doesn't exist), it fails.

One workaround is to use Cwd to obtain the current working dir in a platform-independent way.

Replies are listed 'Best First'.
Re^3: sort system call problem with activestate perl
by bop (Acolyte) on Jul 03, 2008 at 16:05 UTC
    Thank you Moritz,

    that makes sense. However, I don't really know how I can call Cwd from cygwin ("command not found" - I must have a thick day), but this works, working around the string literal issue:
    perl -e 'my $path = `pwd`; system "sort -T " . $path . " --buffer-size=10 ../somefile.txt"'
    
    thank you,
    bop

    PS: I forgot to mention previously that I use such a small buffer size in order to recreate the problem I had (but I'm sure you guessed that).
      However, I don't really know how I can call Cwd from cygwin

      I recommended the Cwd perl module, not a command. It's in core, use it ;-).