Douglas B Rupp wrote: > > > However, it now appears that the redirection is being done by bash > > instead of md4 or dcl. > > In my latter example, that is correct. However I think it wrong to require a > bash -c wrapper to achieve proper redirection. Perl is a shell, or at least > a wannabe shell and should handle redirection internally to be maximally > useful. > > Consider the case of a long command line requiring this redirection. Even > with a bash -c wrapper, it can't work because the lib$spawn will overflow > trying to call bash.
I disagree. Perl is not a shell, it is a scripting language. It is no more a shell than a C compiler or a BASIC interpreter is. One of the security weaknesses in Unix is the presense of shell metacharacters that can completely alter the function of the command and the predilection of programmers to simply pass user input onto things like the "system" function call. Because of this, programs have been made to do things completely different from what the programmer intended. DCL shares very little of this weakness. If a program calls "system" with a command using user supplied arguments, the program can be assured that the command issued is the one that will be executed. The user supplied arguments cannot alter what verb got executed. If you wish a script to alter the way a command is normally interpreted then it is my opinion that it is the job of your script to make the necessary adjustments (e.g. prepend PIPE to the command; prepend bash -c to the command; etc.). The system function is documented as simply passing a string to the host environment to be executed however the host interprets the command. If you wish to create a new Perl function that means "evaluate this string as if it were issued on a Unix system and then set up an environment and execute it accordingly" please feel free to do so. But I'd be opposed to modifying the expectations or operation of "system". Mark Berryman Mark Berryman