swampyankee has asked for the wisdom of the Perl Monks concerning the following question:
O, Great Monks, I've a problem which seems a bit odd and has me both stumped and stupefied
My operating environment is Windows XP Pro. I am developing a program as a wrapper for an InstallShield 11.5 command line build; my program edits the project file (which resembles XML in overall format). This part is not the problem.
The problem is that the program writes a command line ($command). When the command is executed by means of either system($command) or open(my $fh, "$command |") or die, the command fails. My first thought was "no mystery, here. I'm an idiot and screwed up the command line". This thought was wrong. The command line written by my program works fine when executed from the command prompt or from a .bat file. I'm now a confused. Why should this happen? I'm wondering if any of these modules overload either system or open.
use Carp; use ActiveState::DateTime qw(check_date); use Cwd; use Fcntl; use Getopt::Long; use Pod::Usage; use POSIX ; use Tie::File; use Tk; use Win32; use Win32::Process; use Win32API::File qw(:ALL); use constant
After some prodding by CountOrlok (thank you), I poked and tested a bit more thoroughly. My problem occurs because a tied file does not appear to be getting untied; the untie returns an error (untie attempted while 1 inner references still exist).
Reformatted per suggestion by jdporter.
emc
" When in doubt, use brute force." — Ken Thompson
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Execution fails from within Perl; succeeds outside Perl
by CountOrlok (Friar) on Mar 13, 2006 at 18:05 UTC | |
by swampyankee (Parson) on Mar 13, 2006 at 19:54 UTC |