Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: user net:openSSH and File::find::Rule together.

by salva (Canon)
on Feb 15, 2018 at 17:16 UTC ( [id://1209243]=note: print w/replies, xml ) Need Help??


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

Oops, the options to capture have to be passed as a hash reference. I have corrected the code above.

Replies are listed 'Best First'.
Re^4: user net:openSSH and File::find::Rule together.
by garcimo (Novice) on Feb 15, 2018 at 18:34 UTC

    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.

      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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1209243]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (1)
As of 2024-04-19 00:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found