develooper Front page | perl.perl5.porters | Postings from July 2008

Re: cross-platform line-endings (was: Removing files called minus)

From:
Tom Christiansen
Date:
July 30, 2008 21:51
Subject:
Re: cross-platform line-endings (was: Removing files called minus)
Message ID:
19772.1217479866@chthon
In-Reply-To: Message from Ben Morrow <ben@morrow.me.uk> 
   of "Wed, 30 Jul 2008 21:24:31 BST." <v8v6m5-cth1.ln1@osiris.mauzo.dyndns.org> 

> Quoth tchrist@perl.com (Tom Christiansen):

>> I'd rather like a line-discipline-sniffing module that did
>> something like /usr/bin/file does via /etc/magic, and lets you
>> then binmode and/or $/-mangle appropriately.

>> Hey, if *that's* not a magic open (ie, using /etc/magic), I sure
>> dunno what is! :-)

>> I don't suppose anyone might know whether one exists already?

> I wrote one as a proof-of-concept, and Audrey Tang turned it into
> PerlIO::eol, which actually works :).

Lovely!

Thanks much!

--tom



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