Commits

Toby Inkster committed 3830559

smartmatch -> match::smart

Comments (0)

Files changed (2)

lib/Web/ID/Util.pm

 	$Web::ID::Util::VERSION   = '1.922';
 }
 
+use match::simple qw/match/;
 use Carp qw/confess/;
 use Math::BigInt 0 try => 'GMP';
 use RDF::Trine::NamespaceMap;
 	
 	if ($node->is_literal)
 	{
-		given ($node->literal_datatype)
+		for ($node->literal_datatype)
 		{
-			when ($_ ~~ $test_hex)
+			if (match $_, $test_hex)
 			{
 				( my $hex = $node->literal_value ) =~ s/[^0-9A-F]//ig;
 				return Math::BigInt->from_hex("0x$hex");
 			}
 			
-			when ($_ ~~ $test_unsigned)
+			if (match $_, $test_unsigned)
 			{
 				( my $dec = $node->literal_value ) =~ s/[^0-9]//ig;
 				return Math::BigInt->new("$dec");
 			}
 			
-			when ($_ ~~ $test_signed)
+			if (match $_, $test_signed)
 			{
 				( my $dec = $node->literal_value ) =~ s/[^0-9-]//ig;
 				return Math::BigInt->new("$dec");
 			}
 			
-			when ($_ ~~ $test_decimal)
+			if (match $_, $test_decimal)
 			{
 				my ($dec, $frac) = split /\./, $node->literal_value, 2;
 				warn "Ignoring fractional part of xsd:decimal number."
 				return Math::BigInt->new("$dec");
 			}
 			
-			when ($_ ~~ undef)
+			if (match $_, undef)
 			{
 				$opts{'fallback'} = $node;
 			}

meta/makefile.ttl

 		"Digest::SHA",
 		"Exporter::TypeTiny 0.004",
 		"List::MoreUtils",
+		"match::simple 0.004",
 		"Moose",
 		"namespace::sweep",
 		"Path::Class",