in reply to Re: perl regex extraction from a large input file
in thread perl regex extraction from a large input file

The way you store the "Case-Url" and the "Req-URL" as hashes causes the loss of the link between the two. I don't know whether that is important or not. A rather simple approach should do in this case:

while(<DATA>){ print "$1 - " if /\[.*\] - (.*)/i; print "$1\n" if /[*]+([^*]+)/; }

Replies are listed 'Best First'.
Re^3: perl regex extraction from a large input file
by CountZero (Bishop) on Sep 14, 2013 at 10:20 UTC
    Yes indeed. That is the problem with "fuzzy" requirements, there may (or not) be certain data-elements that need to be taken into account.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

    My blog: Imperial Deltronics

      You could store the data as an array rather than hash, only change the one line to

      push @{$results{$pass}{$case_req}}, $url;