DOS-Box, ERRORLEVEL - Programmer

This is a discussion on DOS-Box, ERRORLEVEL - Programmer ; Hi, i hope i'm not off-topic here, please notify me if there's a better group for posting this: A Perl-Skript test.pl: print "i was called\n"; exit 34; A Batch file tst.bat: perl test.pl echo %ERRORLEVEL% When i call the batch ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: DOS-Box, ERRORLEVEL

  1. DOS-Box, ERRORLEVEL

    Hi,

    i hope i'm not off-topic here, please notify me if there's a better
    group for posting this:

    A Perl-Skript test.pl:
    print "i was called\n";
    exit 34;

    A Batch file tst.bat:
    perl test.pl
    echo %ERRORLEVEL%

    When i call the batch file on my PC i get the expected output of 34
    for ERRORLEVEL.

    On the PC of a collegue he gets 9009. I can't explain this. I checked
    his environment settings (output of "SET >settings.txt") but did not
    find anything suspicious.

    We both run Windows 2000 on our office PCs which were installed and
    are maintained by our IT department.


    Can anybody give me a hint on what is wrong and a possible workaround?


    Thanks for any hints,
    Torsten.


  2. Re: DOS-Box, ERRORLEVEL


    "Torsten Mohr" wrote in message
    news:f20pns$p6f$1@schleim.qwe.de...
    > Hi,
    >
    > i hope i'm not off-topic here, please notify me if there's a better
    > group for posting this:
    >
    > A Perl-Skript test.pl:
    > print "i was called\n";
    > exit 34;
    >
    > A Batch file tst.bat:
    > perl test.pl
    > echo %ERRORLEVEL%
    >
    > When i call the batch file on my PC i get the expected output of 34
    > for ERRORLEVEL.
    >
    > On the PC of a collegue he gets 9009. I can't explain this. I checked
    > his environment settings (output of "SET >settings.txt") but did not
    > find anything suspicious.
    >
    > We both run Windows 2000 on our office PCs which were installed and
    > are maintained by our IT department.
    >
    >
    > Can anybody give me a hint on what is wrong and a possible workaround?
    >


    Could it simply be that the shell in which tst.bat is run can't find perl:

    ---------------------
    C:\_32\pscrpt>tst.bat

    C:\_32\pscrpt>perl test.pl
    'perl' is not recognized as an internal or external command,
    operable program or batch file.

    C:\_32\pscrpt>echo 9009
    9009
    ---------------------

    Whereas, once I've added perl to the shell's path:

    ---------------------
    C:\_32\pscrpt>tst.bat

    C:\_32\pscrpt>perl test.pl
    i was called

    C:\_32\pscrpt>echo 34
    34
    ---------------------

    Cheers,
    Rob


  3. Re: DOS-Box, ERRORLEVEL

    Hi,

    the batch file i wrote below was not quite correct,
    in there it did not say "perl test.pl" but just "test.pl".

    On my collegues machine the postfix .pl was not associated to
    the perl interpreter but to some editor.


    Thanks for your hint,
    Torsten.



    > Could it simply be that the shell in which tst.bat is run can't find perl:
    >
    > ---------------------
    > C:\_32\pscrpt>tst.bat
    >
    > C:\_32\pscrpt>perl test.pl
    > 'perl' is not recognized as an internal or external command,
    > operable program or batch file.
    >
    > C:\_32\pscrpt>echo 9009
    > 9009
    > ---------------------
    >
    > Whereas, once I've added perl to the shell's path:
    >
    > ---------------------
    > C:\_32\pscrpt>tst.bat
    >
    > C:\_32\pscrpt>perl test.pl
    > i was called
    >
    > C:\_32\pscrpt>echo 34
    > 34
    > ---------------------
    >
    > Cheers,
    > Rob



+ Reply to Thread