Dear Jupiter,

> b) are the variables what you expect them to be in the spork()ed 
> process?

Following your advice below it seem so. But...

> 
>       spork(
>           sub {
>              my ( $ue, $con_type, $nb_un ) = @_;
> # write the variables to a file here and check that file afterwards
>           },$uemail, $ct, $nu
>       ) or die qq {Could not fork for spork: $!};
> 

But (see the comment inside).


__BEGIN__

use strict;
use Data::Dumper;        
use CGI::Carp qw( fatalsToBrowser );                                            
                                                              
use File::Slurp::SmallFile qw(slurp);                                           
                                                              
use Acme::Spork;         


  my $uemail = '[EMAIL PROTECTED]'; 
  my $code_core   = 'compute_price.pl';                                         
                                                              
  my $ct = 'sugar';
  my $nu = 10;

    # Run the job at the background   
     spork( 
         sub {
            my ( $code, $ue, $con_type, $nb_un ) = @_;

             # This line is ok, it prints correct output inside "spork.test"
             system ("echo $code -email $ue -type $con_type -unit $nb_un > 
spork.test");       

             # But this one not ok...the perl code is not executed.             
                                  
             system ("perl $code -email $ue -type $con_type -unit $nb_un");    
                                                               
         }, $code_core,$uemail, $ct, $nu 
     )
    or die qq {Could not fork for spork: $!};

__END__


As I stated in the comment inside the code.  Echoing witin the system
_works_. But running perl script within system _doesn't work_.

I was wondering is it because Acme::Spork doesn't allow 
system call for perl interpreter. 

Or is it the way I construct  the called perl script is wrong.
 The 'compute_price.pl' script can be found here:
http://rafb.net/paste/results/8oFtJS58.html

I tried not to trouble  you again after this.
But your expert advice is highly valued....

Regards,
Edward WIJAYA
SINGAPORE



------------ Institute For Infocomm Research - Disclaimer -------------
This email is confidential and may be privileged.  If you are not the intended 
recipient, please delete it and notify us immediately. Please do not copy or 
use it for any purpose, or disclose its contents to any other person. Thank you.
--------------------------------------------------------

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to