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
From:
Dave Mitchell
Date:
January 28, 2017 10:21
Subject:
Re: [perl #130652] fail to return true loading .pm with <cr> EOL
Message ID:
20170128101942.GQ4206@iabyn.com
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 Elem.pm 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.


-- 
In economics, the exam questions are the same every year.
They just change the answers.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About