Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Can't print fatal unknown objects, either.

  • Loading branch information...
commit 4e8dc96342fa7eee9a7f577b90daef27cc7cf3bf 1 parent 07ed579
Ovid authored
View
2  dist.ini
@@ -4,7 +4,7 @@ license = Perl_5
copyright_holder = Curtis "Ovid" Poe
copyright_year = 2013
-version = 0.004
+version = 0.005
[@Basic]
[@Git]
View
4 lib/Unknown/Values/Instance.pm
@@ -26,7 +26,9 @@ BEGIN {
}
}
-use overload @to_overload, '""' => sub {'[unknown]'};
+use overload @to_overload, '""' => 'to_string';
+
+sub to_string { '[unknown]' }
sub new {
my $class = shift;
View
5 lib/Unknown/Values/Instance/Fatal.pm
@@ -15,8 +15,13 @@ sub compare {
confess("Comparison operations not allowed with 'fatal unknown' objects");
}
+
sub sort {
confess("Sorting operations not allowed with 'fatal unknown' objects");
}
+sub to_string {
+ confess("Printing not allowed with 'fatal unknown' objects");
+}
+
1;
View
3  t/fatal.t
@@ -16,5 +16,8 @@ qr/Boolean operations not allowed with 'fatal unknown' objects/,
throws_ok { my @foo = sort ( 1, unknown, 2 ) }
qr/Sorting operations not allowed with 'fatal unknown' objects/,
'... or sorting operations';
+throws_ok { print unknown }
+qr/Printing not allowed with 'fatal unknown' objects/,
+ '... or printing unknown values';
done_testing;
Please sign in to comment.
Something went wrong with that request. Please try again.