| Data-Semantic-Net documentation | Contained in the Data-Semantic-Net distribution. |
Data::Semantic::Net::IPAddress::IPv6 - Semantic data class for IPv6 addresses
version 1.101760
my $obj = Data::Semantic::Net::IPAddress::IPv6->new;
if ($obj->is_valid('...')) {
# ...
}
This class can tell whether a value is an IPv6 address. The valid() method
will respect the inherited forbid_internal boolean attribute.
Takes a value and returns true if the indicated IPv4 address is an internal address.
FIXME
See perlmodinstall for information and options on installing Perl modules.
No bugs have been reported.
Please report any bugs or feature requests through the web interface at http://rt.cpan.org.
The latest version of this module is available from the Comprehensive Perl Archive Network (CPAN). Visit http://www.perl.com/CPAN/ to find a CPAN site near you, or see http://search.cpan.org/dist/Data-Semantic-Net/.
The development version lives at http://github.com/hanekomu/Data-Semantic-Net/. Instead of sending patches, please fork this project using the standard git and github infrastructure.
Marcel Gruenauer <marcel@cpan.org>
This software is copyright (c) 2007 by Marcel Gruenauer.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
| Data-Semantic-Net documentation | Contained in the Data-Semantic-Net distribution. |
use 5.008; use strict; use warnings; package Data::Semantic::Net::IPAddress::IPv6; BEGIN { $Data::Semantic::Net::IPAddress::IPv6::VERSION = '1.101760'; } # ABSTRACT: Semantic data class for IPv6 addresses use Net::IP qw/ip_is_ipv6 ip_iptype/; use parent qw(Data::Semantic::Net::IPAddress); sub is_valid_normalized_value { my ($self, $value) = @_; $self->SUPER::is_valid_normalized_value($value) && ip_is_ipv6($value); } sub is_internal { my ($self, $value) = @_; return unless defined $value; my $ip = Net::IP->new($value); return unless $ip; $ip->iptype ne 'GLOBAL-UNICAST'; } sub normalize { my ($self, $value) = @_; my $ip = Net::IP->new($value); return undef unless $ip; $ip->short; } 1; __END__