]> git.refcnt.org Git - colorize.git/blob - readme.pl
Omit declaration of optind/optarg
[colorize.git] / readme.pl
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5
6 my $readme = 'README';
7 my $readme_cgit = 'README.cgit';
8
9 die "$0: $readme does not exist\n" unless -e $readme;
10
11 open(my $fh, '<', $readme) or die "Cannot open $readme for reading: $!\n";
12 my $text = do { local $/; <$fh> };
13 close($fh);
14
15 $text = do {
16 local $_ = $text;
17 s/</&lt;/g;
18 s/>/&gt;/g;
19 $_
20 };
21
22 print "Writing $readme_cgit\n";
23
24 open($fh, '>', $readme_cgit) or die "Cannot open $readme_cgit for writing: $!\n";
25 print {$fh} <<"CGIT";
26 <pre>
27 $text
28 </pre>
29 CGIT
30 close($fh);