|
Posted by Ted Byers on September 16, 2008, 12:13 pm
Please log in for more thread options
Thanks Ben,
That was helpful.
>
>
>
> > Using the latest IndigoPerl, I have two scripts that do not behave
> > alike. =A0Both are in the perl-bin directory of the Apache server
> > distributed with IndigoPerl.
>
> > The first one appended below works fine. =A0It shows the output from a
> > perl script located in a directory tree completely outside the
> > directory tree for IndigoPerl, as well as a system command (this is
> > Windows XP). =A0I get the expected output by providing the URL "http://
> > localhost/perl-bin/format_test.pl" to the browser.
>
> > The second one just hangs, displaying the initial text, but the script
> > appears to stop at the point where TedsMakeNewPortfolios.pl is
> > invoked. =A0it is as if an attempt is made to run my scrpt, and control
> > is never returned to the main script. =A0Yes, an association between
> > perl and the 'pl' extension has been created, and if I invoke
> > TedsMakeNewPortfolios.pl from the commandline (e.g. using
> > "TedsMakeNewPortfolios.pl 522"), it works flawlessly. =A0So why isn't m=
y
> > TedsMakeNewPortfolios.pl being executed?
>
> I would avoid invoking perl scripts like this. There are often issues
> with command-line parameters: the windows association mechanism seems to
> be rather flaky in this respect. Either invoke it as
>
> =A0 =A0 `perl c:\...\TedsMakeNewPortfolios.pl 522`
>
> or as
>
> =A0 =A0 `$^X c:\...\TedsMakeNewPortfolios.pl 522`
>
> if perl isn't in your PATH, or, better, simply call the script using
> 'do'.
>
Well, we're making progress. Before, none of the work that
TedsMakeNewPortfolios.pl handles was done. Now at least the data it
is supposed to produce is produced. I replaced my call with
`perl c:\...\TedsMakeNewPortfolios.pl $id`
Thanks. Now, I know what I need to do to finally fix this. You see,
the LAST thing that TedsMakeNewPortfolios.pl does is start an exe file
a colleague created, and IT starts another perl script that loads the
output data into a database (the language HE used does not have
support/drivers for accessing RDBMS - something that will change this
week). And THAT script is not getting executed.
The example for do in the documentation uses:
do 'stat.pl';
Will it handle command line arguments also. E.g.
do 'myscript.pl $argv[1]';
> > my $output =3D `"C:\yohan\PRODUCTION\MakeNewPortfoliosETF\
> > \TedsMakeNewPortfolios.pl $id"`;
>
> This is wrong. `` passes its contents to cmd /c, which handles any
> further quoting itself. So effectively you are invoking
>
> =A0 =A0 "C:\yohan\...\TedsMakeNewPortfolios.pl 522"
>
> What happens if you type this (*including* the quotes) at the command
> line?
>
This dies with a complain that it isn't recognized as a command,
program or batch file. That makes sense, now that I know the double
quotes would be passed on to cmd.
> Ben
>
> --
> Heracles: Vulture! Here's a titbit for you / A few dried molecules of the=
gall
> =A0 =A0From the liver of a friend of yours. / Excuse the arrow but I have=
no spoon.
> (Ted Hughes, =A0 =A0 =A0 =A0[ Heracles shoots Vulture with arrow. Vulture=
bursts into ]
> =A0'Alcestis') =A0 =A0 =A0 =A0[ flame, and falls out of sight. ] =A0 =A0 =
=A0 =A0 b...@morrow.me.uk
Thanks again
Ted
|