chuckd has asked for the wisdom of the Perl Monks concerning the following question:

Hi,
I'm calling this in my Perl script using the Komodo IDEto get the total lines in a file:
my $length = `wc -l < $ARGV[0]/DAT/metadata.dat`;

I received an error message saying:
'\\emc-filer\etl\data\Jamaica\scripts\Modules' CMD.EXE was started with the above path as the current directory. UNC paths are not supported. Defaulting to Windows directory. 'wc' is not recognized as an internal or external command, operable program or batch file.

I set my env path to C:\cygwin\bin, but that didn't help. Does anyone know how to get this unix command to work on a windows machine with cygwin through Komodo IDE?
  • Comment on using a cygwin command in Komodo IDE for Perl

Replies are listed 'Best First'.
Re: using a cygwin command in Komodo IDE for Perl
by ikegami (Patriarch) on Sep 09, 2008 at 23:55 UTC

    I set my env path to C:\cygwin\bin, but that didn't help.

    I hypothesis that you *think* you did. If either of the following work, you didn't.

    my $length = `c:\\cygwin\\bin\\wc -l < $ARGV[0]/DAT/metadata.dat`;
    $ENV{PATH} = "$ENV{PATH};c:\\cygwin\\bin"; my $length = `wc -l < $ARGV[0]/DAT/metadata.dat`;

    Did you use [ Right click on My Computer | Properties | Advanced | Environment Variables ] as you need to?

    Did you restart Komodo afterwards?

Re: using a cygwin command in Komodo IDE for Perl
by Corion (Patriarch) on Sep 10, 2008 at 06:19 UTC

    In addition, cmd.exe does not really like being launched with an UNC path as the working directory:

    '\\emc-filer\etl\data\Jamaica\scripts\Modules' CMD.EXE was started wit +h the above path as the current directory. UNC paths are not supporte +d.

    I think there is a registry patch to make it ignore that/not issue that warning, but I haven't used it myself.