in reply to Re^2: This has me stumped, pattern matching, 2 files
in thread This has me stumped, pattern matching, 2 files

I used $X, $Y, and $Z just to indicate they can vary and that it doesn't matter where they come from. You didn't specify an actual source for the patterns. If you assign regexen and substitution strings to those variables, the code will work as written -- give or take an /e in the substitution.

The $line{$.} = undef construction just creates a key in the %line hash without associating a value with it. Nothing of the actual file but line numbers is being stored.

After Compline,
Zaxo

  • Comment on Re^3: This has me stumped, pattern matching, 2 files