Browse Subversion Repository
Contents of /trunk/installer/2sjis.pl
Parent Directory
| Revision Log
Revision 4613 -
( show annotations)
( download)
( as text)
Sat Sep 3 05:22:04 2011 UTC
(21 months, 2 weeks ago)
by maya
File MIME type: text/x-perl
File size: 510 byte(s)
ソースが更新されている時だけchmをコンパイルするようにした
| 1 |
#!/usr/bin/perl -w
|
| 2 |
|
| 3 |
require 5.8.0;
|
| 4 |
use strict;
|
| 5 |
use Encode;
|
| 6 |
use utf8;
|
| 7 |
use Getopt::Long;
|
| 8 |
|
| 9 |
my($in, $out, $coding, $lf, $result);
|
| 10 |
$result = GetOptions('in=s' => \$in,
|
| 11 |
'out=s' => \$out,
|
| 12 |
'coding=s' => \$coding,
|
| 13 |
'lf=s' => \$lf);
|
| 14 |
|
| 15 |
open (IN, "<:$lf:encoding($coding)", $in);
|
| 16 |
open (OUT, '>:crlf:encoding(shiftjis)', $out);
|
| 17 |
while (<IN>) {
|
| 18 |
print OUT $_;
|
| 19 |
}
|
| 20 |
close OUT;
|
| 21 |
close IN;
|
| 22 |
|
| 23 |
my(@filestat) = stat $in;
|
| 24 |
utime $filestat[8], $filestat[9], $out;
|
|