| 1 | package Games::Rezrov::ZIO_Tools; | ||||||||||||||
| 2 | |||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 4 | 1 | ▶ | use Exporter; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 5 | |||||||||||||||
| 6 | 1 | @Games::Rezrov::ZIO_Tools::ISA = qw(Exporter); | |||||||||||||
| 7 | 1 | @Games::Rezrov::ZIO_Tools::EXPORT = qw(set_xterm_title | |||||||||||||
| 8 | find_module); | ||||||||||||||
| 9 | |||||||||||||||
| 10 | 0 | ▶ | sub set_xterm_title { | ||||||||||||
|
Subroutine
set_xterm_title: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||
| 11 | # if title is not defined, return whether or not the title *can* be | ||||||||||||||
| 12 | # changed. | ||||||||||||||
| 13 | 0 | my $title = shift; | |||||||||||||
| 14 | # see the comp.windows.x FAQ. | ||||||||||||||
| 15 | 0 | ▶ | if ($ENV{"DISPLAY"}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 16 | # these are X-specific, so... | ||||||||||||||
| 17 | 0 | my $term = $ENV{"TERM"}; | |||||||||||||
| 18 | 0 | my $esc = pack 'c', 27; | |||||||||||||
| 19 | # escape | ||||||||||||||
| 20 | |||||||||||||||
| 21 | 0 | ▶ | if ($term =~ /xterm/i) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 22 | # XTerm | ||||||||||||||
| 23 | 0 | ▶ | if (defined $title) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 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 | ▶ | if (defined $title) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 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 | 0 | ▶ | sub find_module { | ||||||||||||
|
Subroutine
find_module: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||
| 42 | # | ||||||||||||||
| 43 | # Determine whether or not a given Perl module or library is installed | ||||||||||||||
| 44 | # | ||||||||||||||
| 45 | 0 | my $cmd = 'use ' . $_[0]; | |||||||||||||
| 46 | 0 | eval $cmd; | |||||||||||||
| 47 | 0 | ▶ | return $@ ? 0 : 1; | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 48 | } | ||||||||||||||
| 49 | |||||||||||||||
| 50 | 1 | 1; | |||||||||||||