line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
132450
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
38
|
|
2
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
47
|
|
3
|
|
|
|
|
|
|
package WWW::PerlTricksIP; |
4
|
|
|
|
|
|
|
$WWW::PerlTricksIP::VERSION = '0.01'; |
5
|
1
|
|
|
1
|
|
1227
|
use HTTP::Tiny; |
|
1
|
|
|
|
|
36414
|
|
|
1
|
|
|
|
|
36
|
|
6
|
1
|
|
|
1
|
|
16
|
use 5.008; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
35
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# ABSTRACT: Returns your ip address using L |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
BEGIN { |
12
|
1
|
|
|
1
|
|
4
|
require Exporter; |
13
|
1
|
|
|
1
|
|
3
|
use base 'Exporter'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
73
|
|
14
|
1
|
|
|
|
|
2
|
our @EXPORT = 'get_ip'; |
15
|
1
|
|
|
|
|
70
|
our @EXPORT_OK = (); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub get_ip { |
20
|
1
|
|
|
1
|
1
|
15
|
my $response = HTTP::Tiny->new->get('http://perltricks.com/services/echo_ip'); |
21
|
1
|
50
|
|
|
|
331287
|
return $response->{content} if $response->{success}; |
22
|
0
|
|
0
|
|
|
|
die join(' ', 'Error fetching ip: ', |
|
|
|
0
|
|
|
|
|
23
|
|
|
|
|
|
|
($response->{status} or ''), |
24
|
|
|
|
|
|
|
($response->{reason} or '')); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
__END__ |