On Thu, 9 Nov 2017 08:16:47 +0700 thelip sia <hei...@gmail.com> wrote:
> you can use backtick to store the output. > $list = `ssh usern...@domain.com '/usr/bin/perl /cgi-bin/dir-list.pl'`; > Indeed, but note that one should be careful when interpolating strings there: * http://perl-begin.org/topics/security/code-markup-injection/ * https://metacpan.org/pod/String::ShellQuote Also see http://perl-begin.org/tutorials/bad-elements/#declaring_all_vars_at_top regarding predeclaration. > Regards, > Heince > > On Thu, Nov 9, 2017 at 7:15 AM, SSC_perl <p...@surfshopcart.com> wrote: > > > I have a script on a remote server that creates a list of all > > directories on the server that end in a dash. I need that list on my > > laptop. Is it possible to get the result into a variable in my local > > script by triggering the remote script via ssh? I've tried this: > > > > $list = system('ssh usern...@domain.com '/usr/bin/perl /cgi-bin/ > > dir-list.pl'"); > > > > but it just returns '0'. The system call is working fine - I just can't > > get the result returned in $list. > > > > Searching hasn't returned an answer. Is there another way to get > > what I'm after? > > > > Thanks, > > Frank > > -- > > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > > For additional commands, e-mail: beginners-h...@perl.org > > http://learn.perl.org/ > > > > > > -- ----------------------------------------------------------------- Shlomi Fish http://www.shlomifish.org/ At this point, I'd like to take a moment to speak to you about the Adobe PSD format. PSD is not a good format. PSD is not even a bad format. Calling it such would be an insult to other bad formats, such as PCX or JPEG. No, PSD is an abysmal format. — https://github.com/gco/xee/blob/master/XeePhotoshopLoader.m -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/