Bear,
For trouble shooting, it will be helpful to separate the command
from the parameters. And it is better programming since you
control the executable and only let the user provide the
arguments. Ex:
my $tmp = `ls *.txt | fgrep -i "pattern"`;
could turn into
my $tmp = `ls` *.txt | fgrep -i "pattern";
Which is a little safer than giving the user total control of
the command. Maybe ls is not the best example, but hopefully the
idea is OK?
Good luck on the dead line,
Michael
--- Bear Limvere <[EMAIL PROTECTED]> wrote:
> I'm new to the Win32 perl world. Have extensive unix perl
> experience.
>
> I'm running:
> * Windows 2000
> * Apache 1.3 for Windows
> * perl v5.6.1 built for MSWin32-x86-multi-thread. Binary
> build 626
> provided by ActiveState Tool Corp.
> http://www.ActiveState.com.
> Built 01:31:15 May 2 2001
>
> I am converting a fairly large application that uses rcs for
> change-tracking for web data files. In several places, I am
> having
> difficulty capturing output from backticks, using the
> following syntax:
> $var = `command`;
> For some commands it works, and not others. All the scripts
> run fine
> from the ``Command Prompt'' window. The results of the
> commands are
> available, but when the scripts are executed by Apache, some
> of the
> commands do not appear to have any output.
>
> I've also had difficulties with pipe-ing with in the
> backticks. May be a
> totally seperate issue.
>
> For example, I am able to capture the output of:
> $tmpVal = `fgrep -l -i "pattern" *.txt`;
> or
> $files = `ls *.txt`;
> without problems. However, when I run something like:
> my $tmp = `rlog -h c:/path/file.txt`;
> or
> my $tmp = `ls *.txt | fgrep -i "pattern"`;
> NOTHING! I have also tried:
> my $tmp = qx{rlog -h c:/path/file..txt};
> and
> my $cmd = qq{rlog -h c:/path/file.txt};
> open(CMD, "$cmd |") or print "could not exec $cmd: $!
> <br>
";
> while(<CMD>)
> {
> print "$_: $_ <br>
";
> }
>
> All of the .exe commands are in the same directory
> (c:/usr/bin), so I
> don't think it's a path or perms issue. The scripts run fine
> otherwise,
> so it probably not an issue with Apache not being able to
> execute them.
>
> I am up against a heavy deadline (presentation to management),
> and have
> tried everything. HELP! I've looked in the archives of
> ``Apache Week",
> the Apache FAQ, and I've started poking through the
> ActiveState mailing
> lists, and haven't found much so far.
>
> Best regards, Bear ;-D
> --
> _______________________________________
> Bear Limvere -- CSG Telephony CSE
> mailto:[EMAIL PROTECTED]
> Voice: 303.200.3351 Fax: 303.200.3532
> Mitakuye Oyasin -- We are all RELATED!
> _______________________________________________
> Perl-Win32-Web mailing list
> [EMAIL PROTECTED]
>
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web