Profile of Spreadsheet/ParseExcel/Cell.pm

← Index
NYTProf Performance Profile «line view»
For t/bug-md-11.t
Run on Fri Mar 8 13:27:24 2024
Reported on Fri Mar 8 13:30:23 2024

Filename | /home/micha/.plenv/versions/5.38.2/lib/perl5/site_perl/5.38.2/Spreadsheet/ParseExcel/Cell.pm
Statements | Executed 608731 statements in 733ms

Subroutines
Calls | P | F | Exclusive Time | Inclusive Time | Subroutine
--- | --- | --- | --- | --- | ---
202907 | 1 | 1 | 362ms | 362ms | Spreadsheet::ParseExcel::Cell::::newSpreadsheet::ParseExcel::Cell::new
1 | 1 | 1 | 8µs | 10µs | Spreadsheet::ParseExcel::Cell::::BEGIN@19Spreadsheet::ParseExcel::Cell::BEGIN@19
1 | 1 | 1 | 8µs | 20µs | Spreadsheet::ParseExcel::Cell::::BEGIN@169Spreadsheet::ParseExcel::Cell::BEGIN@169
1 | 1 | 1 | 6µs | 20µs | Spreadsheet::ParseExcel::Cell::::BEGIN@20Spreadsheet::ParseExcel::Cell::BEGIN@20
0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Cell::::encodingSpreadsheet::ParseExcel::Cell::encoding
0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Cell::::get_formatSpreadsheet::ParseExcel::Cell::get_format
0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Cell::::get_hyperlinkSpreadsheet::ParseExcel::Cell::get_hyperlink
0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Cell::::get_rich_textSpreadsheet::ParseExcel::Cell::get_rich_text
0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Cell::::is_mergedSpreadsheet::ParseExcel::Cell::is_merged
0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Cell::::typeSpreadsheet::ParseExcel::Cell::type
0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Cell::::unformattedSpreadsheet::ParseExcel::Cell::unformatted
0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Cell::::valueSpreadsheet::ParseExcel::Cell::value

Call graph for these subroutines as a Graphviz dot language file.

Line | State ments | Time on line | Calls | Time in subs | Code
--- | --- | --- | --- | --- | ---
1 |  |  |  |  | package Spreadsheet::ParseExcel::Cell;
2 |  |  |  |  |
3 |  |  |  |  | ###############################################################################
4 |  |  |  |  | #
5 |  |  |  |  | # Spreadsheet::ParseExcel::Cell - A class for Cell data and formatting.
6 |  |  |  |  | #
7 |  |  |  |  | # Used in conjunction with Spreadsheet::ParseExcel.
8 |  |  |  |  | #
9 |  |  |  |  | # Copyright (c) 2014 Douglas Wilson
10 |  |  |  |  | # Copyright (c) 2009-2013 John McNamara
11 |  |  |  |  | # Copyright (c) 2006-2008 Gabor Szabo
12 |  |  |  |  | # Copyright (c) 2000-2006 Kawai Takanori
13 |  |  |  |  | #
14 |  |  |  |  | # perltidy with standard settings.
15 |  |  |  |  | #
16 |  |  |  |  | # Documentation after __END__
17 |  |  |  |  | #
18 |  |  |  |  |
19 | 2 | 15µs | 2 | 11µs | # spent 10µs (8+1) within Spreadsheet::ParseExcel::Cell::BEGIN@19 which was called: # once (8µs+1µs) by Spreadsheet::ParseExcel::BEGIN@35 at line 19 use strict; # spent 10µs making 1 call to Spreadsheet::ParseExcel::Cell::BEGIN@19 # spent 1µs making 1 call to strict::import
20 | 2 | 221µs | 2 | 34µs | # spent 20µs (6+14) within Spreadsheet::ParseExcel::Cell::BEGIN@20 which was called: # once (6µs+14µs) by Spreadsheet::ParseExcel::BEGIN@35 at line 20 use warnings; # spent 20µs making 1 call to Spreadsheet::ParseExcel::Cell::BEGIN@20 # spent 14µs making 1 call to warnings::import
21 |  |  |  |  |
22 | 1 | 200ns |  |  | our $VERSION = '0.66';
23 |  |  |  |  |
24 |  |  |  |  | ###############################################################################
25 |  |  |  |  | #
26 |  |  |  |  | # new()
27 |  |  |  |  | #
28 |  |  |  |  | # Constructor.
29 |  |  |  |  | #
30 |  |  |  |  | # spent 362ms within Spreadsheet::ParseExcel::Cell::new which was called 202907 times, avg 2µs/call: # 202907 times (362ms+0s) by Spreadsheet::ParseXLSX::__ANON__[lib/Spreadsheet/ParseXLSX.pm:443] at line 424 of /home/micha/Projekt/spreadsheet-parsexlsx/lib/Spreadsheet/ParseXLSX.pm, avg 2µs/call sub new {
31 | 202907 | 229ms |  |  | my ( $package, %properties ) = @_;
32 | 202907 | 29.5ms |  |  | my $self = \%properties;
33 |  |  |  |  |
34 | 202907 | 474ms |  |  | bless $self, $package;
35 |  |  |  |  | }
36 |  |  |  |  |
37 |  |  |  |  | ###############################################################################
38 |  |  |  |  | #
39 |  |  |  |  | # value()
40 |  |  |  |  | #
41 |  |  |  |  | # Returns the formatted value of the cell.
42 |  |  |  |  | #
43 |  |  |  |  | sub value {
44 |  |  |  |  |
45 |  |  |  |  | my $self = shift;
46 |  |  |  |  |
47 |  |  |  |  | return $self->{_Value};
48 |  |  |  |  | }
49 |  |  |  |  |
50 |  |  |  |  | ###############################################################################
51 |  |  |  |  | #
52 |  |  |  |  | # unformatted()
53 |  |  |  |  | #
54 |  |  |  |  | # Returns the unformatted value of the cell.
55 |  |  |  |  | #
56 |  |  |  |  | sub unformatted {
57 |  |  |  |  |
58 |  |  |  |  | my $self = shift;
59 |  |  |  |  |
60 |  |  |  |  | return $self->{Val};
61 |  |  |  |  | }
62 |  |  |  |  |
63 |  |  |  |  | ###############################################################################
64 |  |  |  |  | #
65 |  |  |  |  | # get_format()
66 |  |  |  |  | #
67 |  |  |  |  | # Returns the Format object for the cell.
68 |  |  |  |  | #
69 |  |  |  |  | sub get_format {
70 |  |  |  |  |
71 |  |  |  |  | my $self = shift;
72 |  |  |  |  |
73 |  |  |  |  | return $self->{Format};
74 |  |  |  |  | }
75 |  |  |  |  |
76 |  |  |  |  | ###############################################################################
77 |  |  |  |  | #
78 |  |  |  |  | # type()
79 |  |  |  |  | #
80 |  |  |  |  | # Returns the type of cell such as Text, Numeric or Date.
81 |  |  |  |  | #
82 |  |  |  |  | sub type {
83 |  |  |  |  |
84 |  |  |  |  | my $self = shift;
85 |  |  |  |  |
86 |  |  |  |  | return $self->{Type};
87 |  |  |  |  | }
88 |  |  |  |  |
89 |  |  |  |  | ###############################################################################
90 |  |  |  |  | #
91 |  |  |  |  | # encoding()
92 |  |  |  |  | #
93 |  |  |  |  | # Returns the character encoding of the cell.
94 |  |  |  |  | #
95 |  |  |  |  | sub encoding {
96 |  |  |  |  |
97 |  |  |  |  | my $self = shift;
98 |  |  |  |  |
99 |  |  |  |  | if ( !defined $self->{Code} ) {
100 |  |  |  |  | return 1;
101 |  |  |  |  | }
102 |  |  |  |  | elsif ( $self->{Code} eq 'ucs2' ) {
103 |  |  |  |  | return 2;
104 |  |  |  |  | }
105 |  |  |  |  | elsif ( $self->{Code} eq '_native_' ) {
106 |  |  |  |  | return 3;
107 |  |  |  |  | }
108 |  |  |  |  | else {
109 |  |  |  |  | return 0;
110 |  |  |  |  | }
111 |  |  |  |  |
112 |  |  |  |  | return $self->{Code};
113 |  |  |  |  | }
114 |  |  |  |  |
115 |  |  |  |  | ###############################################################################
116 |  |  |  |  | #
117 |  |  |  |  | # is_merged()
118 |  |  |  |  | #
119 |  |  |  |  | # Returns true if the cell is merged.
120 |  |  |  |  | #
121 |  |  |  |  | sub is_merged {
122 |  |  |  |  |
123 |  |  |  |  | my $self = shift;
124 |  |  |  |  |
125 |  |  |  |  | return $self->{Merged};
126 |  |  |  |  | }
127 |  |  |  |  |
128 |  |  |  |  | ###############################################################################
129 |  |  |  |  | #
130 |  |  |  |  | # get_rich_text()
131 |  |  |  |  | #
132 |  |  |  |  | # Returns an array ref of font information about each string block in a "rich",
133 |  |  |  |  | # i.e. multi-format, string.
134 |  |  |  |  | #
135 |  |  |  |  | sub get_rich_text {
136 |  |  |  |  |
137 |  |  |  |  | my $self = shift;
138 |  |  |  |  |
139 |  |  |  |  | return $self->{Rich};
140 |  |  |  |  | }
141 |  |  |  |  |
142 |  |  |  |  | ###############################################################################
143 |  |  |  |  | #
144 |  |  |  |  | # get_hyperlink {
145 |  |  |  |  | #
146 |  |  |  |  | # Returns an array ref of hyperlink information if the cell contains a hyperlink.
147 |  |  |  |  | # Returns undef otherwise
148 |  |  |  |  | #
149 |  |  |  |  | # [0] : Description of link (You may want $cell->value, as it will have rich text)
150 |  |  |  |  | # [1] : URL - the link expressed as a URL. N.B. relative URLs will be defaulted to
151 |  |  |  |  | # the directory of the input file, if the input file name is known. Otherwise
152 |  |  |  |  | # %REL% will be inserted as a place-holder. Depending on your application,
153 |  |  |  |  | # you should either remove %REL% or replace it with the appropriate path.
154 |  |  |  |  | # [2] : Target frame (or undef if none)
155 |  |  |  |  |
156 |  |  |  |  | sub get_hyperlink {
157 |  |  |  |  | my $self = shift;
158 |  |  |  |  |
159 |  |  |  |  | return $self->{Hyperlink} if exists $self->{Hyperlink};
160 |  |  |  |  | return undef;
161 |  |  |  |  | }
162 |  |  |  |  |
163 |  |  |  |  | #
164 |  |  |  |  | ###############################################################################
165 |  |  |  |  | #
166 |  |  |  |  | # Mapping between legacy method names and new names.
167 |  |  |  |  | #
168 |  |  |  |  | {
169 | 3 | 28µs | 2 | 32µs | # spent 20µs (8+12) within Spreadsheet::ParseExcel::Cell::BEGIN@169 which was called: # once (8µs+12µs) by Spreadsheet::ParseExcel::BEGIN@35 at line 169 no warnings; # Ignore warnings about variables used only once. # spent 20µs making 1 call to Spreadsheet::ParseExcel::Cell::BEGIN@169 # spent 12µs making 1 call to warnings::unimport
170 | 1 | 900ns |  |  | *Value = \&value;
171 |  |  |  |  | }
172 |  |  |  |  |
173 | 1 | 2µs |  |  | 1;
174 |  |  |  |  |
175 |  |  |  |  | __END__