in reply to Perl on Win98 vs. Win/NT/2000?

As others have said, the use of backticks in a windows / dos environment doesn't do the same as it does in a Unix environment. Remember, one of the fundamental design decisions with Unix, going back 30 years, was that the system would be build of many small, single function "building blocks", that could be assembled and used easily. That is why we can pipe commands, and why shell functions always use STDIN, STDOUT, STDERR in a known manner.

When Perl calls a system function in a Unix environment, all of these things work as designed. However, what you are trying to do is to get the output from a novell command executing in a temporary Dos shell on a windows operating system. Not wanting to bag Novell or Microsoft here, you are stretching the envelope well beyond what it was originally intended.

As someone else suggested, call the command, redirecting its output to a temporary file, then open that file and process it in the standard file input process. At least that way you have a finer degree of control over what is happening.

Replies are listed 'Best First'.
Re: Re: Perl on Win98 vs. Win/NT/2000?
by jlongino (Parson) on Sep 11, 2001 at 21:57 UTC
    After determining that NAV 2000 was the likely culprit, I have rerun the exact same "map" script posted originally. The results of the Novell/DOS command map perl script (with NAV 2000 disabled):
    perl test.pl Drives A,B,C,D,E map to a local disk. Drive F: = USACSCMAIL01_SYS: \ ----- Search Drives ----- S1: = Z:. [USACSCMAIL01_SYS: \PUBLIC] S2: = C:\PROGRA~1\PERSON~1 S3: = C:\NOVELL\CLIENT32 S4: = C:\WINDOWS S5: = C:\WINDOWS\COMMAND S6: = C:\MSFORT41 S7: = C:\PCW302 S8: = C:\TP7\BIN S9: = C:\MYFILES\GOODIES S10: = C:\BATCH S11: = C:\CLIPPER5\BIN S12: = C:\PERL\BIN S13: = C:\PROGRA~1\IBM\TRACEF~1 Number of lines in @dmap: 17
    For those unfamiliar with the map command:
    MAP General Help 4.13 (97081 +3) ---------------------------------------------------------------------- +-- Purpose: To assign a drive to a directory path. Syntax: MAP [option | /VER] [search:=[drive:=]] | [drive:=] [path] [/ +W] ---------------------------------------------------------------------- +-- To: Use: Insert a search drive. INS Delete a drive mapping. DEL Map the next available drive. N Make the drive a root directory. R Map a drive to a physical volume on a server. P Change a regular drive to a search drive C or a search drive to a regular drive. Display version information /VER Do not change master environment. /W ---------------------------------------------------------------------- +-- For example, to: Type: Map the next available drive MAP N FS1/SYS:LOGIN to the login directory on server FS1 Map drive W: as a search drive MAP S16:=W:=APPS:WP to the WP directory
    When used without any parameters (as in my example) map displays all current drive mappings.
    @a=split??,'just lose the ego and get involved!';
    for(split??,'afqtw{|~'){print $a[ord($_)-97]}