http://qs321.pair.com?node_id=11123133


in reply to Applying regex to each line in a record.

Hi Choroba and Tybalt,

Thank you for the answer!! Truly amazing. It gets rid of the "m" vs "s" confusion by simply not using them!!

I was breaking my head on this for quite a while, and you guys have given such an elegant answer in no time. Some times makes me feel like giving up scripting, but it's too fun and productive. Besides, I still haven't been shooed away from here, so till then I'll stick around. :D

Replies are listed 'Best First'.
Re^2: Applying regex to each line in a record.
by AnomalousMonk (Archbishop) on Oct 24, 2020 at 21:09 UTC
    It gets rid of the "m" vs "s" confusion by simply not using them!!

    /pattern/ is equivalent to m/pattern/. | Nope, pritesh_ugrankar is referring to the /m and /s modifiers! But the following are still a good read. :) See perlre, perlretut (highly recommended!) and perlreref for regex info; also perlop for the m// and s/// (and tr///) operators.


    Give a man a fish:  <%-{-{-{-<