IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Perl Line Endings Puzzle
I want to write my output file with CRLF, because it's going to be used on a VMS system, but I don't particularly want to set $/ to this, because I can't guarantee that the input files will have CRLF and I want Perl to do its "get it right" thing.



Peter
[link|http://www.no2id.net/|Don't Let The Terrorists Win]
[link|http://www.kuro5hin.org|There is no K5 Cabal]
[link|http://guildenstern.dyndns.org|Home]
Use P2P for legitimate purposes!
New There is a small program or Why reinvent the wheel?
Called "flip"

I use it extensively, gooing between Winders and *NIX. It also works for VMS and *NIX.

[greg@king:~]$ apt-cache show flip
Package: flip
Priority: extra
Section: text
Installed-Size: 100
Maintainer: James R. Van Zandt <jrv@debian.org>
Architecture: i386
Version: 1.19-2
Depends: libc6 (>= 2.2.4-4)
Filename: pool/main/f/flip/flip_1.19-2_i386.deb
Size: 11254
MD5sum: 051b718095a06b2424b8aa88cd72decd
Description: convert text file line endings between Unix and DOS formats
This program converts line endings of text files between MS-DOS and
**IX formats. It detects binary files in a nearly foolproof way and
leaves them alone unless you override this. It will also leave files
alone that are already in the right format and preserves file
timestamps. User interrupts are handled gracefully and no garbage or
corrupted files left behind. 'flip' does not convert files to a
different character set, and it can not handle Apple Macintosh
line endings (CR only). For that (and more), you can use the 'recode'
program (package 'recode').
Tag: interface::commandline, role::sw:utility, use::converting, works-with::text


And As you can see, recode does other things.
[greg@king:~]$ apt-cache show recode
Package: recode
Priority: optional
Section: text
Installed-Size: 456
Maintainer: Santiago Vila <sanvila@debian.org>
Architecture: i386
Version: 3.6-12
Depends: libc6 (>= 2.3.5-1), librecode0 (>= 3.6)
Filename: pool/main/r/recode/recode_3.6-12_i386.deb
Size: 179340
MD5sum: 1e80d340ab9802477d24ef3602f487f7
Description: Character set conversion utility
Free `recode' converts files between character sets and usages. When
exact transliterations are not possible, it may get rid of the
offending characters or fall back on approximations. This program
recognizes or produces nearly 300 different character sets and is able
to transliterate files between almost any pair. Most RFC 1345
character sets, and all `libiconv' character sets, are supported.

--
[link|mailto:greg@gregfolkert.net|greg],
[link|http://www.iwethey.org/ed_curry|REMEMBER ED CURRY!] @ iwethey
Freedom is not FREE.
Yeah, but 10s of Trillions of US Dollars?
SELECT * FROM scog WHERE ethics > 0;

0 rows returned.
New Small glitch.
C:\\Documents and Settings\\pwhysall>apt-get install flip\n'apt-get' is not recognized as an internal or external command,\noperable program or batch file.


Peter
[link|http://www.no2id.net/|Don't Let The Terrorists Win]
[link|http://www.kuro5hin.org|There is no K5 Cabal]
[link|http://guildenstern.dyndns.org|Home]
Use P2P for legitimate purposes!
New He isn't talking Per on Windows dew-ma
--
[link|mailto:greg@gregfolkert.net|greg],
[link|http://www.iwethey.org/ed_curry|REMEMBER ED CURRY!] @ iwethey
Freedom is not FREE.
Yeah, but 10s of Trillions of US Dollars?
SELECT * FROM scog WHERE ethics > 0;

0 rows returned.
New Use binmode then print \\r\\n on line endings.
I have come to believe that idealism without discipline is a quick road to disaster, while discipline without idealism is pointless. -- Aaron Ward (my brother)
New Ta, that sounds like just the ticket.


Peter
[link|http://www.no2id.net/|Don't Let The Terrorists Win]
[link|http://www.kuro5hin.org|There is no K5 Cabal]
[link|http://guildenstern.dyndns.org|Home]
Use P2P for legitimate purposes!
New A different reply...
Just so you can see the code easily I've include [link|http://www.gregfolkert.net/sources/flip-1.19/flip.c|flip.c as a link here], [link|http://www.gregfolkert.net/sources/flip-1.19/flip.h|flip.h] (actually the whole debian source for it [link|http://www.gregfolkert.net/sources/|here])

I thought it might give you an idea or something. As I guess the someone you are researching for only wants to do this in Perl.
--
[link|mailto:greg@gregfolkert.net|greg],
[link|http://www.iwethey.org/ed_curry|REMEMBER ED CURRY!] @ iwethey
Freedom is not FREE.
Yeah, but 10s of Trillions of US Dollars?
SELECT * FROM scog WHERE ethics > 0;

0 rows returned.
New My Apologies to you Peter.
I read it was Ben Tilly doing the asking. So yes, I was wrong.

Also, read Ben's response to you.
--
[link|mailto:greg@gregfolkert.net|greg],
[link|http://www.iwethey.org/ed_curry|REMEMBER ED CURRY!] @ iwethey
Freedom is not FREE.
Yeah, but 10s of Trillions of US Dollars?
SELECT * FROM scog WHERE ethics > 0;

0 rows returned.
     Perl Line Endings Puzzle - (pwhysall) - (7)
         There is a small program or Why reinvent the wheel? - (folkert) - (2)
             Small glitch. - (pwhysall) - (1)
                 He isn't talking Per on Windows dew-ma -NT - (folkert)
         Use binmode then print \\r\\n on line endings. -NT - (ben_tilly) - (1)
             Ta, that sounds like just the ticket. -NT - (pwhysall)
         A different reply... - (folkert)
         My Apologies to you Peter. - (folkert)

They're behind the couch.
69 ms