more useful options | |
PerlMonks |
Re: Is a here-doc a good way to retrieve data file contents for testing?by BillKSmith (Monsignor) |
on Jan 17, 2021 at 20:01 UTC ( [id://11127042]=note: print w/replies, xml ) | Need Help?? |
The 'file' which you are simulating almost certainly has a newline at the end of every (including the last) line. The 'chomp' to remove the newline from the last line of your test file serves as a reminder that the same function is needed in the real code.
Bill
In Section
Seekers of Perl Wisdom
|
|