This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Curliff and liff with ease.
[perl5.git] / Porting / curliff.pl
CommitLineData
39dbb0c0
JH
1#!/usr/bin/perl -ws
2
3# curliff.pl - convert certain files in the Perl distribution that
4# need to be in CR-LF format to CR-LF, or back to LF format (with the
5# -r option). The CR-LF format is NOT to be used for checking in
6# files to the Perforce repository, but it IS to be used when making
7# Perl snapshots or releases.
8
9use strict;
10
11use vars qw($r);
12
13my @FILES = qw(
14 djgpp/configure.bat
15 README.ce
16 README.dos
17 README.win32
18 win32/Makefile
19 win32/makefile.mk
20 wince/compile-all.bat
21 wince/README.compile
22 wince/README.perlce
23 wince/registry.bat
24 );
25
26{
27 local($^I, @ARGV) = ('.orig', @FILES);
28 while (<>) {
29 if ($r) {
30 s/\015\012/\012/; # Curliffs to liffs.
31 } else {
32 s/\015?\012/\015\012/; # Curliffs and liffs to curliffs.
33 }
34 print;
35 close ARGV if eof; # Reset $.
36 }
37}