N
Nene
Hello,
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
want?
###
#!/usr/bin/perl -w
use strict;
use warnings;
my $misc = '192.168.xxx.xxx.';
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]{5}|[1-9]{6,9}) msecs/ ) {
print LOG "$current_line\n";
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
want?
###
#!/usr/bin/perl -w
use strict;
use warnings;
my $misc = '192.168.xxx.xxx.';
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]{5}|[1-9]{6,9}) msecs/ ) {
print LOG "$current_line\n";