Perl 5.8.0, calling ext. commands: how to force CMD.EXE instead

Perl 5.8.0, calling ext. commands: how to force CMD.EXE instead

Post by arie » Mon, 01 Nov 2004 09:26:51


In message < XXXX@XXXXX.COM > - Sat, 30 Oct 2004 20:42:55
+0100jp < XXXX@XXXXX.COM > writes:



It's the usual "backtiks" call in which a string should receive STDOUT
of the called command:

$ls = "dir /s /f";
$ls_mask = "<path>/*.jpg";

$ls_lines = `$ls $ls_mask`;


Are the paths really hardcoded? From reading the docs I understand that
env. vars should be able to change theese paths (COMSPEC, EXECSHELL)
but neither works...

TIA,
******************************************************************************
* Arie Kazachin, Israel, e-mail: XXXX@XXXXX.COM *
******************************************************************************
NOTE: before replying, leave only letters in my domain-name. Sorry, SPAM trap.
 
 
 

Perl 5.8.0, calling ext. commands: how to force CMD.EXE instead

Post by Dave Savil » Mon, 01 Nov 2004 18:47:51


I use this version although I built it myself.

SET COMSPEC=C:\OS2\CMD.EXE
SET PERLLIB_PREFIX=e:/usr/lib/perl/lib;d:\usr\lib\perl\lib
SET PERL_SH_DIR=d:\BIN

Is all I have in config.sys, I don't have EXECSHELL.

The perllib is because it was built on e: and yes that gets hardcoded,
but this env var switches it to where it is *installed*.

I do have a *nix type shell in /bin.

Works for me - all ways of invoking - backticks, system(.... etc.

HTH

Regards

Dave Saville

NB Remove no-spam- for good email address

 
 
 

Perl 5.8.0, calling ext. commands: how to force CMD.EXE instead

Post by arie » Tue, 02 Nov 2004 05:35:13

In message < XXXX@XXXXX.COM > - "Dave
Saville" < XXXX@XXXXX.COM >Sun, 31 Oct 2004 09:47:51 GMT writes:




Thanks Dave, I think what I misunderstood was the hardcoded build path
and the following installed path which I should set according to my system
(I think).

Thanks for everyone who replyed,
******************************************************************************
* Arie Kazachin, Israel, e-mail: XXXX@XXXXX.COM *
******************************************************************************
NOTE: before replying, leave only letters in my domain-name. Sorry, SPAM trap.