I am trying to run a remote find command but I have to pass it local variables whose value I get from command line arguments from user. But, I am getting an "undefined variable" error. I am doing something like :
my $ssh = Net::OpenSSH->new($host);
#I am getting a part of the $path and $pattern from command line
#I have to look for $pattern at the $path
my @files = $ssh->capture(q(find $path -name $pattern) );
This command runs fine when I give the exact path and pattern but I get error when I replace it with variables.