SHEIKH Sajjad wrote:
> 
> Hi all,
> 
> I get strange results.

Not really, when you understand what is going on.

> 
> In following, if I run only one script it generates LOGFILE.txt
> 
> But, If I run all of them together, I get the error message
> c:\LOGFILE.txt can not be found.  Which is true since I don't find
> logfile.txt. 
> 
> Does anyone know why my script is not working?
> 
> my $x;

You have declared a scalar $x, ist value is undefined at this stage.

> $x = "Z:\\bin\\perl.exe run_batch3.pl";       #generates logfile.txt

You have just overwritten the value in $x with "Z:\\bin\\perl.exe
run_batch3.pl"

> $x = "Z:\\bin\\perl.exe run_batch4.pl";   #takes logfile.txt as an
> argument and generates dirlist.xml

You have just overwritten the value in $x with "Z:\\bin\\perl.exe
run_batch4.pl"

> $x = "Z:\\bin\\perl.exe run_batch6.pl";  #takes dirlist.xml and
> generates list.xml 

You have just overwritten the value in $x with "Z:\\bin\\perl.exe
run_batch6.pl"

> 
> foreach ($x) {system($x);}

The loop is redundant as there is only a single value. You might just as
well have written:

        system "Z:\\bin\\perl.exe run_batch6.pl";

You should have used an array for this:

my @x = ("Z:\\bin\\perl.exe run_batch3.pl",
         "Z:\\bin\\perl.exe run_batch3.pl",
         "Z:\\bin\\perl.exe run_batch6.pl");
foreach ($x) {system($x);}

HTH

-- 
Brian Raven
 


-----------------------------------------------------------------------
The information contained in this e-mail is confidential and solely 
for the intended addressee(s). Unauthorised reproduction, disclosure, 
modification, and/or distribution of this email may be unlawful. If you 
have received this email in error, please notify the sender immediately 
and delete it from your system. The views expressed in this message 
do not necessarily reflect those of LIFFE Holdings Plc or any of its subsidiary 
companies.
-----------------------------------------------------------------------


_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to