in reply to Re^3: user net:openSSH and File::find::Rule together.
in thread user net:openSSH and File::find::Rule together.

could the contents of the data feed by stdin_data we put in a subroutine instead..

I tried to put it in a subroutine like this:
sub finder { use File::Find::Rule; my $today = time(); my $onehour = $today - (60*60); my @files = File::Find::Rule->file() ->name("*.0") ->mtime("<$onehour") ->in( "/export/home/adm_garcimo" ); for my $file (@files) { return $file; } }
then call the subroutine:
my $output = $ssh->capture({stdin_data => <<'EOS'}, '/usr/bin/perl'); finder() EOS print $output
but it does not find the subroutine..

thanks again.

Replies are listed 'Best First'.
Re^5: user net:openSSH and File::find::Rule together.
by salva (Canon) on Feb 15, 2018 at 18:39 UTC
    No, what you send in stdin_data must be a complete script.

    As I already told you, for more complex things you can use Object::Remote.