in reply to Re^2: Regex returns match the first time. It returns everything thereafter
in thread Regex returns match the first time. It returns everything thereafter

Hi Rolf,
What would you suggest I use?

  • Comment on Re^3: Regex returns match the first time. It returns everything thereafter

Replies are listed 'Best First'.
Re^4: Regex returns match the first time. It returns everything thereafter
by aaron_baugher (Curate) on Nov 18, 2013 at 21:27 UTC

    Something like this should work:

    my $found=0; print grep { $found or ( /line/ and $found=1 )} @ssh;

    Aaron B.
    Available for small or large Perl jobs and *nix system administration; see my home node.