It is not an issue of connection with the server! I am looking for ways to perform string match over a large log file. I tried the following over a telnet object and my %parseLogData contains more than one string to be matched.
my $cmd="cat $logName"; @content = $self->{conn}->cmd($cmd); unless ( @content = $self->{conn}->cmd($cmd)){ $logger->error(__PACKAGE__ . ".$sub_name: Failed to execute th +e shell command:$cmd "); $logger->debug(__PACKAGE__ . ".$sub_name: <-- Leaving Sub [0]" +); return 0; for my $i ( 0 .. $#{$parseLogData{$_}}) { my $parseString = $parseLogData{$_}[$i]; my $flag = 0; if (@line = grep{/\Q$parseString\E/i} @content) { $logger->debug(__PACKAGE__ . ".$sub_name: PARSE SUCCESS: Expec +ted -> \"$parseString\" in \"$logName\": Count of Matches -> $#line") +; $flag = 1; } else { $logger->debug(__PACKAGE__ . ".$sub_name: PARSE FAILED: Expect +ed :: -> \"$parseString\" in \"$logName\" "); } }
The above code works well for smaller log files but fails over large file sizes. other approach was to copy the file locally and perform parsing, which is not possible due to server restriction to establish FTP session. Hence I need to know any other alternative for my problem. Thanks.

In reply to Parsing large File remotely by lazyreader

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.