using SSH without modules

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!


My object is to do a few things without the use of modules, I only
know how to use
open(SSH, "$ssh $command |") || die "ssh: $!";

But I want to cd into a directory and search through multiple files.
My example below opens a single file. Is it possble to do what I

#!/usr/bin/perl -w
use strict;
use warnings;

my $misc = '';
my $MAX = '100';

foreach my $x (1..$MAX) {

my $ssh = "ssh user\@$misc";
my $command = "perl -ne 'print' /root/file/log.txt";

open(SSH, "$ssh $command |") || die "ssh: $!";

print "connected to $misc$x\n";

while (my $current_line = <SSH>) {
my $QUERY = 'regex1_example';
my $QUERY_1 = 'regex2_example';

if ( $current_line =~ /COMPLETE: (?:$QUERY|$QUERY_1) .* from \S+
complete in (?:[3-9]|[1-9]) msecs/ ) {

print LOG "$current_line\n";

Site Timeline