in reply to Unable to match newline
Just some thoughts:
If you want to compare Perl with grep you need to compare the same behaviour.
Your grep uses -z ("Treat the input as a set of lines, each terminated by a zero byte (the ASCII NUL character) instead of a newline."). So it breaks the "classical" definition of a line.
I do not see something similar in your perl command. So it uses the "classical" line definition. At the same time, I think, your Regex in the perl command would not match a newline character with the '.', because it does not use the /s modifier.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Unable to match newline
by robinson (Novice) on Nov 17, 2015 at 19:57 UTC | |
by linuxer (Curate) on Nov 17, 2015 at 20:10 UTC | |
by robinson (Novice) on Nov 17, 2015 at 20:37 UTC |
In Section
Seekers of Perl Wisdom