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

I am working on WIndows Server 2008. This is the output of executing cmd as suggested by you
D:\iw-home>\iw-perl\bin\iwperl httpd\iw-bin\javaTest.pl The system cannot find the path specified. D:\iw-home>\iw-perl\bin\iwperl \httpd\iw-bin\javaTest.pl The system cannot find the path specified.
I am still getting same result.
D:\iw-home>\iw-home\iw-perl\bin\iwperl \iw-home\httpd\iw-bin\javaTest. +pl File is created!
Its working, when I execute this cmd, starting with iw-home. So why does it not work, when I am execuing this cmd from iw-home dir ? Why do I have to put iw-home in path , even afetr I am executing it from this dir only ?

Replies are listed 'Best First'.
Re: Path issue
by BrowserUk (Patriarch) on Jan 15, 2014 at 22:14 UTC

    Because you left the first / in place:

    D:\iw-home>/iw-perl/bin/iwperl /httpd/iw-bin/javaTest.pl ...........^

    Which means it is looking in root for a subdir called iw-perl. Remove the leading / and things should work.

    (I assume you're using a cygwin shell hence /s)


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      D:\iw-home>
      I don't think OP is using a Cygwin shell. It looks like a 'cmd' shell, but you're correct that OP should strip out the leading '/' and if not, should replace all those '/'s with '\' - since Windows may not recognise '/' as a path separator.
Re: Path issue
by andal (Hermit) on Jan 16, 2014 at 07:34 UTC

    Leading / indicates that searching for the path must be done from the top of the file system. If you want searching to be started from current directory, then remove it or preceed with '.' indicating current directory. So it would be

    D:\iw-home>/iw-perl/bin/iwperl httpd/iw-bin/javaTest.pl

    Disclaimer, these are the rules for "unix" environment. I don't know how perl handles things under windows.