File Coverage

blib/lib/Language/Befunge/lib/NULL.pm
Criterion Covered Total %
statement 8 11 72.7
branch n/a
condition n/a
subroutine 3 5 60.0
pod 1 1 100.0
total 12 17 70.5


line stmt bran cond sub pod time code
1             #
2             # This file is part of Language::Befunge.
3             # Copyright (c) 2001-2009 Jerome Quelin, all rights reserved.
4             #
5             # This program is free software; you can redistribute it and/or modify
6             # it under the same terms as Perl itself.
7             #
8             #
9              
10             package Language::Befunge::lib::NULL;
11              
12 1     1   3222 use strict;
  1         3  
  1         35  
13 1     1   5 use warnings;
  1         2  
  1         131  
14              
15 0     0 1   sub new { return bless {}, shift; }
16              
17              
18             # basic IP reflection
19             sub _reverse {
20 0     0     my (undef, $interp) = @_;
21 0           $interp->get_curip->dir_reverse;
22             }
23              
24             #
25             # for each of the library instructions, override it with a reflection.
26             #
27             BEGIN {
28 1     1   5 for my $l ( 'A'..'Z' ) {
29 26         1271 eval "*$l = \\&_reverse";
30             }
31             }
32              
33              
34             1;
35             __END__