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

I have some Perl Code that was written by someone else. I know just enough to maintain it and that's about it. There is a call from one perl script to another like this findloc.pl/1

In Windows 2000 Server and earlier this worked fine. In Windows 2003 Server it doesn't. Removing the /1 works but I don't know what it does. The script that is called doesn't appear to do anything with it.

Thanks for any help you can give.

Mark

janitored by ybiC: Retitle from "What does this mean?", minor format tweaks

Replies are listed 'Best First'.
Re: "findlog.pl/1" broke in Win2003
by Corion (Patriarch) on Feb 13, 2004 at 18:59 UTC

    Even though the original poster possibly won't be around to read this, I think I now know what he meant to express:

    Originally, the script contained a call to another script (let's call it findloc.pl) like this:

    system( 'findloc.pl/1' );

    For some reason or another, "it dosen't work anymore". The "fix" was to remove the /1:

    system( 'findloc.pl' );

    The NT shell (cmd.exe) treats everything starting with a slash as a switch to the program, so in the first case, the second script was being launched with $ARGV[0] eq '/1'. With the change, $ARGV[0] is (most likely) undef.

    So I guess that the real change was in the called script findloc.pl.

Re: "findlog.pl/1" broke in Win2003
by adrianh (Chancellor) on Feb 13, 2004 at 17:18 UTC

    The problem is on line 67.

    (aka - you'll need to show us the code, tell us what happens when it does/does not work, etc. :-)

      Sorry, I thought it was some sort of standard call that you all would be familiar with. I'm not able to get at the code right now but will post it later. As for "when it does/does not work" is doesn't ever work as long as the /1 is there. Seems like it's getting treated as a URL separator instead of part of the call to the Perl script. Mark
        A reply falls below the community's threshold of quality. You may see it by logging in.
Re: "findlog.pl/1" broke in Win2003
by flyingmoose (Priest) on Feb 13, 2004 at 17:41 UTC
    Remove the \1, run plenty of tests, and see if anything blows up.

    DISCLAIMER: If you work in air-traffic control or a nuclear plant, or perhaps with heavy machinery, belay that last suggestion.

Re: "findlog.pl/1" broke in Win2003
by Abigail-II (Bishop) on Feb 13, 2004 at 17:34 UTC
    /1 divides whatever was on the left side by 1. In most case, you can freely omit it; it won't even upset the hazelnut bunnies. On the other hand, /1 could be the start or a regular expression. But it'll be hard to come up with some code where you can freely remove a /1 starting a regex, and still end up with a compilable program.

    And maybe it's a sign from God saying you shouldn't have upgraded to Windows 2003, but to OpenBSD instead.

    Abigail

Re: "findlog.pl/1" broke in Win2003
by mutated (Monk) on Feb 13, 2004 at 18:58 UTC
    In versions of windows before 2003 you used \ as a directory divider, ie cd \, in *nix / is used..I suspect the windows 2003/xp/whatever are trying to allow for both \ and / to be used, to test this try findloc.pl /1 (note the space between the .pl and the /) and see if you still get the same error, I suspect not..need to see the source code to know for sure as `findloc.pl/1` and `findloc.pl`/1 are completely different, in the first /1 is being passed as a parm to findloc.pl and the second the results are being divided by 1.
Re: "findlog.pl/1" broke in Win2003 (fix)
by tye (Sage) on Feb 13, 2004 at 19:21 UTC

    I don't see what is so hard to understand about the question.

    I suspect the solution is as simple as adding a space ("findloc.pl /1") so that the Win2003 command shell doesn't try to find a file matching "1.*" in some "findloc.pl" directory.

    - tye