in reply to Re: How Do I Get Batch Input to Work in DOS?
in thread How Do I Get Batch Input to Work in DOS?

Thanks for the response. Here are some more details - The script is a format checker (aka linter) for script input - to ensure against typos. You provide the directory where the files are located, indicate the exam you want performed and the script generates a report of any errors found. If you want to retest- well, an input file of commands would be helpful, thus my question. Here's the code snippet that receives the input.
if( $runnum < 1) { $cwd = Win32::GetCwd(); $prgmdir = $cwd; # $prgmpth = "$prgmdir\\"; print "\nProgram thinks it is located in the following directo +ry:\n"; print "\t$cwd\n"; print "if incorrect (PATH has spaces)! Enter full path or ret +urn\n\n"; chomp ($prgmd = <STDIN>); if( $prgmd =~ /^([a-zA-Z];\\).+$/ ) { $prgmdir = $prgmd; } else { $prgmdir = $cwd; } $prgmdir =~ /^(\w:).*/; $prgmdrv = $1 . ":"; }
When I run the script, I get the above query which seems to get some input (but nothing obvious on screen) where it next goes to the menu containing the "exit" command and then goes to the dos prompt as if it concluded. A check of the output directory indicates no activity. I expected to see some material to the screen and/or results in the work directory - but this is not the case, thus the question on what it would take to get it to work. jmk

Replies are listed 'Best First'.
Re^3: How Do I Get Batch Input to Work in DOS?
by Riales (Hermit) on Mar 01, 2012 at 20:52 UTC

    When you run your script, do you get those lines about where the program thinks it is and if it's incorrect to enter the full path or return? Have you tried adding a print after you assign to $prgmdrv to see what it's doing at that point? (Standard 'print statements everywhere!' advice, but still...)

    I wonder if it might make more sense to modify the original script to optionally take an input file of commands instead of trying to pipe the commands in externally?