Debian Codegraph @

cpan/autodie/t/lib/pujHa/ghach/Dotlh.pm

raw
1 package pujHa::ghach::Dotlh;
2
3 # Translator notes: Dotlh = status
4
5 # Ideally this should be le'wI' - Thing that is exceptional. ;)
6 # Unfortunately that results in a file called .pm, which may cause
7 # problems on some filesystems.
8
9 use strict;
10 use warnings;
11
12 use parent qw(autodie::exception);
13
14 sub stringify {
15 my ($this) = @_;
16
17 my $error = $this->SUPER::stringify;
18
19 return "QaghHommeyHeylIjmo':\n" . # Due to your apparent minor errors
20 "$error\n" .
21 "lujqu'"; # Epic fail
22
23
24 }
25
26 1;
27
28 __END__
29
30 # The following was a really neat idea, but currently autodie
31 # always pushes values in $! to format them, which loses the
32 # Klingon translation.
33
34 use Errno qw(:POSIX);
35 use Scalar::Util qw(dualvar);
36
37 my %translation_for = (
38 EPERM() => q{Dachaw'be'}, # You do not have permission
39 ENOENT() => q{De' vItu'laHbe'}, # I cannot find this information.
40 );
41
42 sub errno {
43 my ($this) = @_;
44
45 my $errno = int $this->SUPER::errno;
46
47 warn "In tlhIngan errno - $errno\n";
48
49 if ( my $tlhIngan = $translation_for{ $errno } ) {
50 return dualvar( $errno, $tlhIngan );
51 }
52
53 return $!;
54
55 }
56
57 1;
58
59