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:
demerphq
Date:
January 28, 2017 11:36
Subject:
Re: [perl #130652] fail to return true loading .pm with <cr> EOL
Message ID:
CANgJU+X20XMtDyOSKyW=Wrj6h2Def4de40TuO_YvvbGFqzLg3w@mail.gmail.com
On 28 Jan 2017 18:21, "Dave Mitchell" <davem@iabyn.com> 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 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.


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

Yves

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