File: Dotlh.pm

package info (click to toggle)
libautodie-perl 2.10-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 528 kB
  • ctags: 305
  • sloc: perl: 4,012; makefile: 4
file content (59 lines) | stat: -rw-r--r-- 1,156 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package pujHa'ghach::Dotlh;

# Translator notes: Dotlh = status

# Ideally this should be le'wI' - Thing that is exceptional. ;)
# Unfortunately that results in a file called .pm, which may cause
# problems on some filesystems.

use strict;
use warnings;

use base qw(autodie::exception);

sub stringify {
    my ($this) = @_;

    my $error = $this->SUPER::stringify;

    return "QaghHommeyHeylIjmo':\n" .   # Due to your apparent minor errors
           "$error\n" .
           "lujqu'";                    # Epic fail


}

1;

__END__

# The following was a really neat idea, but currently autodie
# always pushes values in $! to format them, which loses the
# Klingon translation.

use Errno qw(:POSIX);
use Scalar::Util qw(dualvar);

my %translation_for = (
    EPERM()  => q{Dachaw'be'},        # You do not have permission
    ENOENT() => q{De' vItu'laHbe'},   # I cannot find this information.
);

sub errno {
    my ($this) = @_;

    my $errno = int $this->SUPER::errno;

    warn "In tlhIngan errno - $errno\n";

    if ( my $tlhIngan = $translation_for{ $errno } ) {
        return dualvar( $errno, $tlhIngan );
    }

    return $!;

}

1;