|
Server : LiteSpeed System : Linux srv526460274 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 User : kerao9884 ( 1082) PHP Version : 8.0.30 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /usr/lib/x86_64-linux-gnu/perl5/5.34/auto/NetAddr/IP/ |
Upload File : |
# NOTE: Derived from blib/lib/NetAddr/IP.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package NetAddr::IP;
#line 829 "blib/lib/NetAddr/IP.pm (autosplit into blib/lib/auto/NetAddr/IP/_compV6.al)"
#sub _old_compV6 {
# my @addr = split(':',shift);
# my $found = 0;
# my $v;
# foreach(0..$#addr) {
# ($v = $addr[$_]) =~ s/^0+//;
# $addr[$_] = $v || 0;
# }
# @_ = reverse(1..$#addr);
# foreach(@_) {
# if ($addr[$_] || $addr[$_ -1]) {
# last if $found;
# next;
# }
# $addr[$_] = $addr[$_ -1] = '';
# $found = '1';
# }
# (my $rv = join(':',@addr)) =~ s/:+:/::/;
# return $rv;
#}
# thanks to Rob Riepel <riepel@networking.Stanford.EDU>
# for this faster and more compact solution 11-17-08
sub _compV6 ($) {
my $ip = shift;
return $ip unless my @candidates = $ip =~ /((?:^|:)0(?::0)+(?::|$))/g;
my $longest = (sort { length($b) <=> length($a) } @candidates)[0];
$ip =~ s/$longest/::/;
return $ip;
}
# end of NetAddr::IP::_compV6
1;