line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Id: /mirror/coderepos/lang/perl/Encode-Argv/trunk/lib/Encode/Argv.pm 50486 2008-04-15T14:50:02.946222Z daisuke $ |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Encode::Argv; |
4
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
70
|
|
5
|
2
|
|
|
2
|
|
8
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
66
|
|
6
|
2
|
|
|
2
|
|
26
|
use 5.8.0; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
76
|
|
7
|
2
|
|
|
2
|
|
4168
|
use Encode (); |
|
2
|
|
|
|
|
32466
|
|
|
2
|
|
|
|
|
295
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.00002'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub import |
11
|
|
|
|
|
|
|
{ |
12
|
4
|
|
|
4
|
|
11471
|
my ($class, $decode_from, $encode_to) = @_; |
13
|
|
|
|
|
|
|
|
14
|
4
|
100
|
|
|
|
16
|
if (! $decode_from) { |
15
|
2
|
|
|
|
|
3
|
eval { |
16
|
2
|
|
|
|
|
2311
|
require Term::Encoding; |
17
|
0
|
|
|
|
|
0
|
$decode_from = Term::Encoding::get_encoding(); |
18
|
|
|
|
|
|
|
}; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
4
|
100
|
|
|
|
20
|
if ($decode_from) { |
22
|
2
|
|
|
|
|
5
|
foreach (@ARGV) { |
23
|
8
|
|
|
|
|
124
|
$_ = Encode::decode($decode_from, $_); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
4
|
100
|
|
|
|
198
|
if ($encode_to) { |
28
|
1
|
|
|
|
|
3
|
foreach (@ARGV) { |
29
|
4
|
|
|
|
|
82
|
$_ = Encode::encode($encode_to, $_); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__END__ |