line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::Show; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
101010
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
52
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
53
|
|
5
|
1
|
|
|
1
|
|
6
|
use utf8; |
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
7
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
1716
|
use Path::Tiny; |
|
1
|
|
|
|
|
22263
|
|
|
1
|
|
|
|
|
110
|
|
8
|
1
|
|
|
1
|
|
987
|
use Browser::Open; |
|
1
|
|
|
|
|
4446
|
|
|
1
|
|
|
|
|
198
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.001'; # VERSION |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=encoding utf-8 |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 NAME |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
HTML::Show - Show html in a browser locally |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 SYNOPSIS |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
use HTML::Show; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
HTML::Show::show('Showing htmlShow html'); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 DESCRIPTION |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
Show html in the local browser without url, only with the content. |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
This module does not export anything and the interface is "sub" oriented, but the API is subject to changes. |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 FUNCTIONS |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=cut |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head2 show |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
Show the html content. Accept anything that can be stringified. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=cut |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub show { |
41
|
0
|
|
|
0
|
1
|
|
my $html_file = Path::Tiny::tempfile( UNLINK => 0, SUFFIX => '.html' ); |
42
|
0
|
|
|
|
|
|
$html_file->spew_utf8( "" . shift() ); |
43
|
0
|
|
|
|
|
|
Browser::Open::open_browser( $html_file->canonpath() ); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
__END__ |