sachinmozarkar has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

I am using Grid::Machine for connecting the remote machine and modput to copy the module over remote
But I am Facing problem while passing an argument to remote module function


my $a=10;
$machine->modput('sample','sample');
$r = $machine->eval(q{
print $a."Value of A\n"; # It's not working
sample->function($a);
});

Replies are listed 'Best First'.
Re: How can I pass arguments to remote module function
by moritz (Cardinal) on Aug 17, 2009 at 06:39 UTC
    The remote machine doesn't know about your lexical variables, you have to pass those that you want to use as additional arguments to ->eval().

    (Assuming you meant GRID::Machine, not Grid::Module which doesn't seem to exist on CPAN). (Update: the OP has changed the title in the mean time...)

    A reply falls below the community's threshold of quality. You may see it by logging in.