> -----Original Message----- > From: Paul Johnson > Sent: Tuesday, April 18, 2017 15:29 > > On Tue, Apr 18, 2017 at 12:32:57PM -0400, Jason Pyeron wrote: > > I am "require"ing a file but Devel::Cover is not logging > the statements, only the sub, use, and eval portions. > > > > I tried a do(filename.pl) to no help. > > > > I tried adding -subs_only off (and on) to no effect. > > > > Any suggestions? > > The problem here is the require or do. After running the top-level > statements, perl throws them away, which means that by the time > Devel::Cover comes to match up the data it has recorded against the > ops in the program it can't find the ops for those top-level statements.
That is sad. > > I had originally thought it would be quite easy to persuade > perl not to > throw away such statements, but it has proven beyond my abilities so > far. > > The toolchain summit is coming up shortly and I may see if I can't > impose on one of the clever folk who will be attending for a little > assistance. That would be awesome. How can I help? > > So, my only practical suggestion, I'm afraid, is to bundle all the > top-level statements into a subroutine (which, as an old C > programmer I > tend to call "main") and then call that subroutine as the > only top-level > statement. Changing the the code to support this is not an option. -Jason