line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Games::Rezrov::ZIO_Tools; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
44
|
|
4
|
1
|
|
|
1
|
|
5
|
use Exporter; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
310
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
@Games::Rezrov::ZIO_Tools::ISA = qw(Exporter); |
7
|
|
|
|
|
|
|
@Games::Rezrov::ZIO_Tools::EXPORT = qw(set_xterm_title |
8
|
|
|
|
|
|
|
find_module); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub set_xterm_title { |
11
|
|
|
|
|
|
|
# if title is not defined, return whether or not the title *can* be |
12
|
|
|
|
|
|
|
# changed. |
13
|
0
|
|
|
0
|
0
|
|
my $title = shift; |
14
|
|
|
|
|
|
|
# see the comp.windows.x FAQ. |
15
|
0
|
0
|
|
|
|
|
if ($ENV{"DISPLAY"}) { |
16
|
|
|
|
|
|
|
# these are X-specific, so... |
17
|
0
|
|
|
|
|
|
my $term = $ENV{"TERM"}; |
18
|
0
|
|
|
|
|
|
my $esc = pack 'c', 27; |
19
|
|
|
|
|
|
|
# escape |
20
|
|
|
|
|
|
|
|
21
|
0
|
0
|
|
|
|
|
if ($term =~ /xterm/i) { |
|
|
0
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# XTerm |
23
|
0
|
0
|
|
|
|
|
if (defined $title) { |
24
|
0
|
|
|
|
|
|
printf "%s]2;%s%s", $esc, $title, pack('c', 7); # bell |
25
|
|
|
|
|
|
|
} else { |
26
|
0
|
|
|
|
|
|
return 1; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
} elsif ($term eq "vt300") { |
29
|
|
|
|
|
|
|
# DECTerm? |
30
|
0
|
0
|
|
|
|
|
if (defined $title) { |
31
|
0
|
|
|
|
|
|
printf '%s]21;%s%s\\', $esc, $title, $esc; |
32
|
|
|
|
|
|
|
} else { |
33
|
0
|
|
|
|
|
|
return 1; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
return 0; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub find_module { |
42
|
|
|
|
|
|
|
# |
43
|
|
|
|
|
|
|
# Determine whether or not a given Perl module or library is installed |
44
|
|
|
|
|
|
|
# |
45
|
0
|
|
|
0
|
0
|
|
my $cmd = 'use ' . $_[0]; |
46
|
0
|
|
|
|
|
|
eval $cmd; |
47
|
0
|
0
|
|
|
|
|
return $@ ? 0 : 1; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |