| 1 | package Mail::Decency::Helper::IP; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 11 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 11 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | |||||||||||||||||||||
| 6 | 11 | ▶ | use version 0.74; our $VERSION = qv( "v0.1.4" ); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | 11 | ▶ | use base qw/ Exporter /; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 9 | 11 | our @EXPORT_OK = qw/ | |||||||||||||||||||
| 10 | is_local_host | ||||||||||||||||||||
| 11 | /; | ||||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | =head1 NAME | ||||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | Mail::Decency::Helper::IP | ||||||||||||||||||||
| 16 | |||||||||||||||||||||
| 17 | =head1 DESCRIPTION | ||||||||||||||||||||
| 18 | |||||||||||||||||||||
| 19 | Helper for everything about ips .. | ||||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | =cut | ||||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | 0 | ▶ | sub is_local_host { | ||||||||||||||||||
|
Subroutine
is_local_host: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||
| 24 | 0 | my ( $ip ) = @_; | |||||||||||||||||||
| 25 | 0 | ▶ | return index( $ip, '127.' ) == 0 || $ip eq '::1'; | ||||||||||||||||||
|
Condition0%0/3
index($ip, '127.') == 0 || $ip eq '::1'
MC/DC0%0/2
index($ip, '127.') == 0 || $ip eq '::1'
index($ip, '127.') == 0
$ip eq '::1'
Truth table0%0/3
A || B
A= index($ip, '127.') == 0B= $ip eq '::1'
| |||||||||||||||||||||
| 26 | } | ||||||||||||||||||||
| 27 | |||||||||||||||||||||
| 28 | =head1 AUTHOR | ||||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | Ulrich Kautz <uk@fortrabbit.de> | ||||||||||||||||||||
| 31 | |||||||||||||||||||||
| 32 | =head1 COPYRIGHT | ||||||||||||||||||||
| 33 | |||||||||||||||||||||
| 34 | Copyright (c) 2010 the L</AUTHOR> as listed above | ||||||||||||||||||||
| 35 | |||||||||||||||||||||
| 36 | =head1 LICENCSE | ||||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | This library is free software and may be distributed under the same terms as perl itself. | ||||||||||||||||||||
| 39 | |||||||||||||||||||||
| 40 | =cut | ||||||||||||||||||||
| 41 | |||||||||||||||||||||
| 42 | |||||||||||||||||||||
| 43 | 11 | 1; | |||||||||||||||||||