in reply to Re: How to use REGEX Match Variable from one 'While' String in Another 'While' String
in thread How to use REGEX Match Variable from one 'While' String in Another 'While' String

Ah! Much easier than I was expecting. Thank you very much for the help! Seems like removing the $line_in did the trick. The regex match only had alphanumeric characters and underscores, so special characters wasn't an issue.

I also removed the extra open and close of the file. Thank you for the suggestion! I really appreciate you taking the time to respond.

  • Comment on Re^2: How to use REGEX Match Variable from one 'While' String in Another 'While' String

Replies are listed 'Best First'.
Re^3: How to use REGEX Match Variable from one 'While' String in Another 'While' String
by Anonymous Monk on May 07, 2014 at 22:39 UTC
    The regex match only had alphanumeric characters and underscores...

    If your $pkt_file doesn't contain regular expressions, it's probably better to use \Q$pkt\E, because that'll prevent your program from doing unexpected things if $pkt does someday for whatever reason contain special characters. Similar to what AnomalousMonk wrote below about $1 $2 $3 etc. it's a "future-proofing" measure.