develooper Front page | perl.perl5.porters | Postings from January 2017

Re: [perl #130652] fail to return true loading .pm with <cr> EOL

Thread Previous | Thread Next
January 28, 2017 11:36
Re: [perl #130652] fail to return true loading .pm with <cr> EOL
Message ID:
On 28 Jan 2017 18:21, "Dave Mitchell" <> wrote:

On Thu, Jan 26, 2017 at 10:06:18PM +0000, ROYAL, Ryan wrote:
> Sure, see attached.
> For some reason my Notepad++ "EOL Conversion" was set to Macintosh <CR>
and this is what caused the bug (on a PC).
> Setting the EOL to either Unix <LF> or Windows <CR><LF> fixed it.

Since contains no newline characters, perl will see it as a file
containing only a single long line. Halfway along this line is a '#'
character which starts a comment that continues until the end of the line,
which in this case is the whole rest of the file. So the '1;' at the end
of the file is commented out and not executed. So the require doesn't
return a true value and so fails.

So not a bug.

At the same time we could treat lone \r as break no? (IOW treat it as a
feature not a bug)


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About