|
|
|
Your skill will accomplish what the force of many cannot |
|
| PerlMonks |
Re^2: error printing all text in text fileby davido (Cardinal) |
| on Jan 11, 2022 at 16:14 UTC ( [id://11140376]=note: print w/replies, xml ) | Need Help?? |
|
It's likely that snippet should be:
And that is pretty much functionally equivalent to:
...except that his code would append a newline at the end of the file if one wasn't there already. So $show =~ s/(?<!\n)\z/\n/ if that trailing newline is important. If he intended to keep the lines separated then he could slurp into an array. Dave
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||