Ask a Question related to PERL Miscellaneous, Design and Development.
-
Gordon #1
Perl system() command failing under CYGWIN
Hi,
I am trying to install a software product that uses Perl under CYGWIN
and am having a problem with the Perl system() command failing.
The following script works from a Windows 2000 cmd prompt:
!#g:\perl\bin
print "dir\n";
system ( "dir");
The following script run from the CYGWIN prompt (on the same PC),
prints 'ls[return]' but fails to execute the 'system ("ls") command;
no error is displayed it just skips over the system() line:
!#g:/perl/bin
print "ls\n";
system("ls");
Perl & Cygwin are supplied with the software, so I am hesitant to
upgrade them. Perl is v5.005_002. PC is running Windows 2000 Server
SP3 as recommended by the software supplier.
I have tried the usual Google and mailing list archive searches with
no luck. So, any suggestions are much appreciated.
TIA,
Gordon
Gordon Guest
-
Installation problem - Net-SNMP Perl Modules on cygwin
When Net-SNMP Perl modules are installed in cygwin $cd net-snmp5.2.1/perl $perl MakeFile.PL Writing Makefile for NetSNMP::default_store... -
Off Topic: Active Perl Native Windows / cygwin perl
I have both activestate windows native perl installed and the default cygwin perl. How can I have the cygwin shell use the windows perl rather... -
Help: Install DBI-Oracle on cygwin with Perl 5.8.0
Hi All: I am new in the Perl world. So far I have installed cygwin and Perl 5.8.0 along with Perl DBI and DBD::Oracle modules. NowI am trying to... -
Problem with the Perl System command
Hi, I am facing an issue with the perl system command The relevant lines of code are the following: chdir "$util"; my @args =... -
Cplex hangs in Perl system command
wei_zhao2000@hotmail.com (Wei) wrote in news:2673a9d5.0308041236.5d6b6c52 @posting.google.com: Does your C program close the CPLEX... -
Helgi Briem #2
Re: Perl system() command failing under CYGWIN
On 10 Sep 2003 01:19:21 -0700, [email]gordonp@myrealbox.com[/email] (Gordon) wrote:
No, it works fine. Oh, you wanted to see the output?>The following script run from the CYGWIN prompt (on the same PC),
>prints 'ls[return]' but fails to execute the 'system ("ls") command;
>no error is displayed it just skips over the system() line:
>!#g:/perl/bin
>print "ls\n";
>system("ls");
Then you don't want to use the system function,
you want to use backticks or qx as specified in the
perlFAQ:
perlfaq -q "Why can't I get the output of a command with system()?"
If your cygwin directory is not in path, you may need
to supply the full path to ls. You will definitely have
to do that if this is supposed to run as a CGI.
You should also ALWAYS check external and
system calls for errors with warn or die as appropriate!
my $ls = 'C:/cygwin/bin/ls.exe';
my $output = qx/$ls/ or die "Cannot run $ls:$!\n";
print $output;
Ancient. Do yourself a favour and upgrade.>Perl & Cygwin are supplied with the software, so I am hesitant to
>upgrade them. Perl is v5.005_002.
perldoc comes first, Google later.>I have tried the usual Google and mailing list archive searches with
>no luck. So, any suggestions are much appreciated.
Helgi Briem Guest



Reply With Quote

