in reply to Re^3: diff not working as it should
in thread diff not working as it should

Not seeing much on the STYLE option.
I can use the regex m/(^\*)/ and that gives me what I need for the most part.
But where in the code can I use this regex? That is, can it be used as part of the diff command, as in { sub (m/(^\*)/) } ? (yes, I know this is not syntactically correct but you get the idea.)
Cheers!

Replies are listed 'Best First'.
Re^5: diff not working as it should
by pvaldes (Chaplain) on Dec 23, 2011 at 20:47 UTC

    you have two lines of code, so it should be easy to choose... start just in the third line

    open the output file enter a loop reading line by line print only the matching lines close and reopen send it again to the file and you have it.
      Yes, I understand -- and have gone ahead -- and did the regex with some extra code after the diff(). And I thank you for your input.
      I was just wondering if there was some way to do the regex within the diff command or diff command options (I don't see anything at first glance.)
      Cheers!

        Well, maybe I can save you some work. If you want to do this, I suggest you to use Algorithm::Diff in its place

        The example script "diff.pl" provided with the module Algorithm::Diff does exactly what you want and is ready to use. You will find it in the directory after unzip and untar this package (you will need to install the module before to be able to use it, of course):

        diff.pl file1 file2 ___ 5+ this is the line 5 (in file 1) 5- this is the lime 5 (in file 2)