| 1 | package Tie::Handle::CSV; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 11 | ▶ | use 5.006; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 11 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 11 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 11 | ▶ | use Carp; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 11 | ▶ | use Symbol; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 11 | ▶ | use Scalar::Util; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 11 | ▶ | use Text::CSV_XS; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 11 | ▶ | use Tie::Handle::CSV::Hash; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | 11 | ▶ | use Tie::Handle::CSV::Array; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 11 | our $VERSION = '0.15'; | |||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | sub new | ||||||||||||||||||||||||||||
| 18 | 28 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 19 | 28 | my $class = shift; | |||||||||||||||||||||||||||
| 20 | 28 | my $self = bless gensym(), $class; | |||||||||||||||||||||||||||
| 21 | 28 | tie *$self, $self; | |||||||||||||||||||||||||||
| 22 | 28 | $self->_open(@_); | |||||||||||||||||||||||||||
| 23 | 19 | return $self; | |||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | sub TIEHANDLE | ||||||||||||||||||||||||||||
| 27 | 37 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
TIEHANDLE: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||
| 28 | 37 | ▶ | return $_[0] if ref $_[0]; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 29 | 9 | my $class = shift; | |||||||||||||||||||||||||||
| 30 | 9 | return $class->new(@_); | |||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | sub _open | ||||||||||||||||||||||||||||
| 34 | 28 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
_open: called CC=25 SCAR=32.2
| |||||||||||||||||||||||||||||
| 35 | 28 | my ($self, @opts) = @_; | |||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | 28 | my ($file, %opts, $csv_fh); | |||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | ## if an odd number of options are given, | ||||||||||||||||||||||||||||
| 40 | ## assume the first arg is the file name | ||||||||||||||||||||||||||||
| 41 | 28 | ▶ | if (@opts % 2) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 42 | { | ||||||||||||||||||||||||||||
| 43 | 23 | $file = shift @opts; | |||||||||||||||||||||||||||
| 44 | 23 | %opts = @opts; | |||||||||||||||||||||||||||
| 45 | 23 | $opts{'file'} = $file; | |||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||
| 47 | else | ||||||||||||||||||||||||||||
| 48 | { | ||||||||||||||||||||||||||||
| 49 | 5 | %opts = @opts; | |||||||||||||||||||||||||||
| 50 | } | ||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | ## support old 'openmode' option key | ||||||||||||||||||||||||||||
| 53 | 28 | ▶ | if ( exists $opts{'openmode'} && ! exists $opts{'open_mode'} ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
exists $opts{"openmode"} and not exists $opts{"open_mode"}
MC/DC100%2/2
exists $opts{"openmode"} and not exists $opts{"open_mode"}
exists $opts{"openmode"}
not exists $opts{"open_mode"}
Truth table100%3/3
A and not(B)
A= exists $opts{"openmode"}B= not exists $opts{"open_mode"}
| |||||||||||||||||||||||||||||
| 54 | { | ||||||||||||||||||||||||||||
| 55 | 1 | $opts{'open_mode'} = $opts{'openmode'}; | |||||||||||||||||||||||||||
| 56 | } | ||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | ## support old 'stringify' option key | ||||||||||||||||||||||||||||
| 59 | 28 | ▶ | if ( exists $opts{'stringify'} && ! exists $opts{'simple_reads'} ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
exists $opts{"stringify"} and not exists $opts{"simple_reads"}
MC/DC100%2/2
exists $opts{"stringify"} and not exists $opts{"simple_reads"}
exists $opts{"stringify"}
not exists $opts{"simple_reads"}
Truth table100%3/3
A and not(B)
A= exists $opts{"stringify"}B= not exists $opts{"simple_reads"}
| |||||||||||||||||||||||||||||
| 60 | { | ||||||||||||||||||||||||||||
| 61 | 1 | $opts{'simple_reads'} = ! $opts{'stringify'}; | |||||||||||||||||||||||||||
| 62 | } | ||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||
| 64 | 28 | ▶ | my $file_ref_type = Scalar::Util::reftype( $opts{'file'} ) || ''; | ||||||||||||||||||||||||||
|
Condition100%2/2
builtin::reftype($opts{'file'}) || ''
MC/DC100%1/1
builtin::reftype($opts{'file'}) || ''
builtin::reftype($opts{'file'})
Truth table100%2/2
A
A= builtin::reftype($opts{'file'})
| |||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||
| 66 | 28 | ▶ | if ( $file_ref_type eq 'GLOB' ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 67 | { | ||||||||||||||||||||||||||||
| 68 | 1 | $csv_fh = $opts{'file'}; | |||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||
| 70 | else | ||||||||||||||||||||||||||||
| 71 | { | ||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||
| 73 | ## use 3-arg open if 'open_mode' is specified, | ||||||||||||||||||||||||||||
| 74 | ## otherwise use 2-arg to work with STDIN via '-' | ||||||||||||||||||||||||||||
| 75 | 27 | ▶ | if ( defined $opts{'open_mode'} ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 76 | { | ||||||||||||||||||||||||||||
| 77 | 5 | ▶ | open( $csv_fh, $opts{'open_mode'}, $opts{'file'} ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 78 | || croak "$!: $opts{'file'}"; | ||||||||||||||||||||||||||||
| 79 | } | ||||||||||||||||||||||||||||
| 80 | else | ||||||||||||||||||||||||||||
| 81 | { | ||||||||||||||||||||||||||||
| 82 | 22 | ▶ | open( $csv_fh, $opts{'file'} ) || croak "$!: $opts{'file'}"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 83 | } | ||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||
| 85 | } | ||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||
| 87 | ## establish the csv object | ||||||||||||||||||||||||||||
| 88 | ## use given sep_char when possible | ||||||||||||||||||||||||||||
| 89 | 20 | ▶ | if ( $opts{'csv_parser'} ) | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 90 | { | ||||||||||||||||||||||||||||
| 91 | 2 | ▶ | if ( ref $opts{'csv_parser'} ne 'Text::CSV_XS' ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 92 | { | ||||||||||||||||||||||||||||
| 93 | 1 | confess "'csv_parser' is not an instance of 'Text::CSV_XS'"; | |||||||||||||||||||||||||||
| 94 | } | ||||||||||||||||||||||||||||
| 95 | } | ||||||||||||||||||||||||||||
| 96 | elsif ( defined $opts{'sep_char'} ) | ||||||||||||||||||||||||||||
| 97 | { | ||||||||||||||||||||||||||||
| 98 | $opts{'csv_parser'} = | ||||||||||||||||||||||||||||
| 99 | 2 | Text::CSV_XS->new( { sep_char => $opts{'sep_char'}, binary => 1 } ); | |||||||||||||||||||||||||||
| 100 | } | ||||||||||||||||||||||||||||
| 101 | else | ||||||||||||||||||||||||||||
| 102 | { | ||||||||||||||||||||||||||||
| 103 | 16 | $opts{'csv_parser'} = Text::CSV_XS->new( { binary => 1 } ); | |||||||||||||||||||||||||||
| 104 | } | ||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||
| 106 | 19 | ▶ | $opts{'header'} = 1 unless exists $opts{'header'}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||
| 108 | 19 | ▶ | if ( $opts{'header'} ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 109 | { | ||||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||
| 111 | 14 | ▶ | if ( ref $opts{'header'} ne 'ARRAY' ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 112 | { | ||||||||||||||||||||||||||||
| 113 | 9 | my $header_line = <$csv_fh>; | |||||||||||||||||||||||||||
| 114 | $opts{'csv_parser'}->parse($header_line) | ||||||||||||||||||||||||||||
| 115 | 9 | ▶ | || croak $opts{'csv_parser'}->error_input(); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 116 | 9 | $opts{'header'} = [ $opts{'csv_parser'}->fields() ]; | |||||||||||||||||||||||||||
| 117 | } | ||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||
| 119 | 14 | $opts{'orig_header'} = [ @{ $opts{'header'} } ]; | |||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||
| 121 | ## support old 'force_lower' option key | ||||||||||||||||||||||||||||
| 122 | 14 | ▶ | if ( $opts{'force_lower'} && ! $opts{'key_case'} ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$opts{"force_lower"} and not $opts{"key_case"}
MC/DC100%2/2
$opts{"force_lower"} and not $opts{"key_case"}
$opts{"force_lower"}
not $opts{"key_case"}
Truth table100%3/3
A and not(B)
A= $opts{"force_lower"}B= not $opts{"key_case"}
| |||||||||||||||||||||||||||||
| 123 | { | ||||||||||||||||||||||||||||
| 124 | 4 | $opts{'key_case'} = 'lower'; | |||||||||||||||||||||||||||
| 125 | } | ||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||
| 127 | 14 | ▶ | if ( $opts{'key_case'} ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 128 | { | ||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||
| 130 | 9 | ▶ | if ( lc $opts{'key_case'} eq 'lower' ) | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 131 | { | ||||||||||||||||||||||||||||
| 132 | 6 | for my $header ( @{ $opts{'header'} } ) | |||||||||||||||||||||||||||
| 133 | { | ||||||||||||||||||||||||||||
| 134 | 18 | $header = lc $header; | |||||||||||||||||||||||||||
| 135 | } | ||||||||||||||||||||||||||||
| 136 | } | ||||||||||||||||||||||||||||
| 137 | elsif ( lc $opts{'key_case'} eq 'upper' ) | ||||||||||||||||||||||||||||
| 138 | { | ||||||||||||||||||||||||||||
| 139 | 1 | for my $header ( @{ $opts{'header'} } ) | |||||||||||||||||||||||||||
| 140 | { | ||||||||||||||||||||||||||||
| 141 | 3 | $header = uc $header; | |||||||||||||||||||||||||||
| 142 | } | ||||||||||||||||||||||||||||
| 143 | } | ||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||
| 145 | } | ||||||||||||||||||||||||||||
| 146 | |||||||||||||||||||||||||||||
| 147 | } | ||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||
| 149 | 19 | *$self->{handle} = $csv_fh; | |||||||||||||||||||||||||||
| 150 | 19 | *$self->{opts} = \%opts; | |||||||||||||||||||||||||||
| 151 | } | ||||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||
| 153 | sub READLINE | ||||||||||||||||||||||||||||
| 154 | 64 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
READLINE: called CC=7 SCAR=19.5
| |||||||||||||||||||||||||||||
| 155 | 64 | my ($self) = @_; | |||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||
| 157 | 64 | my $opts = *$self->{'opts'}; | |||||||||||||||||||||||||||
| 158 | |||||||||||||||||||||||||||||
| 159 | 64 | ▶ | if (wantarray) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 160 | { | ||||||||||||||||||||||||||||
| 161 | |||||||||||||||||||||||||||||
| 162 | 1 | my @parsed_lines; | |||||||||||||||||||||||||||
| 163 | |||||||||||||||||||||||||||||
| 164 | 1 | ▶ | while (my $parsed_line = $self->READLINE) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 165 | { | ||||||||||||||||||||||||||||
| 166 | 3 | push @parsed_lines, $parsed_line; | |||||||||||||||||||||||||||
| 167 | } | ||||||||||||||||||||||||||||
| 168 | |||||||||||||||||||||||||||||
| 169 | 1 | return @parsed_lines; | |||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||
| 171 | } | ||||||||||||||||||||||||||||
| 172 | else | ||||||||||||||||||||||||||||
| 173 | { | ||||||||||||||||||||||||||||
| 174 | 63 | my $cols = $opts->{'csv_parser'}->getline(*$self->{'handle'}); | |||||||||||||||||||||||||||
| 175 | 63 | ▶ | if (defined $cols) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 176 | { | ||||||||||||||||||||||||||||
| 177 | 44 | ▶ | if ( $opts->{'header'} ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 178 | { | ||||||||||||||||||||||||||||
| 179 | 33 | my $parsed_line; | |||||||||||||||||||||||||||
| 180 | |||||||||||||||||||||||||||||
| 181 | 33 | ▶ | if ( $opts->{'simple_reads'} ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 182 | { | ||||||||||||||||||||||||||||
| 183 | 11 | @{ $parsed_line }{ @{ $opts->{'header'} } } = @{ $cols }; | |||||||||||||||||||||||||||
| 184 | } | ||||||||||||||||||||||||||||
| 185 | else | ||||||||||||||||||||||||||||
| 186 | { | ||||||||||||||||||||||||||||
| 187 | 22 | $parsed_line = Tie::Handle::CSV::Hash->_new($self); | |||||||||||||||||||||||||||
| 188 | 22 | $parsed_line->_init_store( $cols ); | |||||||||||||||||||||||||||
| 189 | } | ||||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||
| 191 | 33 | return $parsed_line; | |||||||||||||||||||||||||||
| 192 | } | ||||||||||||||||||||||||||||
| 193 | else | ||||||||||||||||||||||||||||
| 194 | { | ||||||||||||||||||||||||||||
| 195 | 11 | my $parsed_line; | |||||||||||||||||||||||||||
| 196 | |||||||||||||||||||||||||||||
| 197 | 11 | ▶ | if ( $opts->{'simple_reads'} ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 198 | { | ||||||||||||||||||||||||||||
| 199 | 3 | @{ $parsed_line } = @{ $cols }; | |||||||||||||||||||||||||||
| 200 | } | ||||||||||||||||||||||||||||
| 201 | else | ||||||||||||||||||||||||||||
| 202 | { | ||||||||||||||||||||||||||||
| 203 | 8 | $parsed_line = Tie::Handle::CSV::Array->_new($self); | |||||||||||||||||||||||||||
| 204 | 8 | $parsed_line->_init_store( $cols ); | |||||||||||||||||||||||||||
| 205 | } | ||||||||||||||||||||||||||||
| 206 | |||||||||||||||||||||||||||||
| 207 | 11 | return $parsed_line; | |||||||||||||||||||||||||||
| 208 | } | ||||||||||||||||||||||||||||
| 209 | } | ||||||||||||||||||||||||||||
| 210 | |||||||||||||||||||||||||||||
| 211 | } | ||||||||||||||||||||||||||||
| 212 | |||||||||||||||||||||||||||||
| 213 | 19 | return; | |||||||||||||||||||||||||||
| 214 | |||||||||||||||||||||||||||||
| 215 | } | ||||||||||||||||||||||||||||
| 216 | |||||||||||||||||||||||||||||
| 217 | sub CLOSE | ||||||||||||||||||||||||||||
| 218 | 19 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
CLOSE: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 219 | 19 | my ($self) = @_; | |||||||||||||||||||||||||||
| 220 | 19 | return close *$self->{'handle'}; | |||||||||||||||||||||||||||
| 221 | } | ||||||||||||||||||||||||||||
| 222 | |||||||||||||||||||||||||||||
| 223 | sub PRINT | ||||||||||||||||||||||||||||
| 224 | 1 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
PRINT: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 225 | 1 | my ($self, @list) = @_; | |||||||||||||||||||||||||||
| 226 | 1 | my $handle = *$self->{'handle'}; | |||||||||||||||||||||||||||
| 227 | 1 | return print $handle @list; | |||||||||||||||||||||||||||
| 228 | } | ||||||||||||||||||||||||||||
| 229 | |||||||||||||||||||||||||||||
| 230 | sub SEEK | ||||||||||||||||||||||||||||
| 231 | 3 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
SEEK: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 232 | 3 | my ($self, $position, $whence) = @_; | |||||||||||||||||||||||||||
| 233 | 3 | return seek *$self->{'handle'}, $position, $whence; | |||||||||||||||||||||||||||
| 234 | } | ||||||||||||||||||||||||||||
| 235 | |||||||||||||||||||||||||||||
| 236 | sub TELL | ||||||||||||||||||||||||||||
| 237 | 2 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
TELL: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 238 | 2 | my ($self) = @_; | |||||||||||||||||||||||||||
| 239 | 2 | return tell *$self->{'handle'}; | |||||||||||||||||||||||||||
| 240 | } | ||||||||||||||||||||||||||||
| 241 | |||||||||||||||||||||||||||||
| 242 | sub header | ||||||||||||||||||||||||||||
| 243 | 5 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
header: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||
| 244 | 5 | my ($self) = @_; | |||||||||||||||||||||||||||
| 245 | 5 | my $opts = *$self->{opts}; | |||||||||||||||||||||||||||
| 246 | 5 | my $header = $opts->{orig_header}; | |||||||||||||||||||||||||||
| 247 | 5 | my $parser = $opts->{csv_parser}; | |||||||||||||||||||||||||||
| 248 | |||||||||||||||||||||||||||||
| 249 | 5 | ▶ | if ( ! $header || ref $header ne 'ARRAY' ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
not $header or ref $header ne "ARRAY"
MC/DC50%1/2
not $header or ref $header ne "ARRAY"
not $header
ref $header ne "ARRAY"
Truth table66%2/3
not(A) or B
A= not $headerB= ref $header ne "ARRAY"
| |||||||||||||||||||||||||||||
| 250 | { | ||||||||||||||||||||||||||||
| 251 | 1 | croak "handle does not contain a header"; | |||||||||||||||||||||||||||
| 252 | } | ||||||||||||||||||||||||||||
| 253 | |||||||||||||||||||||||||||||
| 254 | 4 | my $header_array = Tie::Handle::CSV::Array->_new($self); | |||||||||||||||||||||||||||
| 255 | 4 | @{ $header_array } = @{$header}; | |||||||||||||||||||||||||||
| 256 | 4 | return $header_array; | |||||||||||||||||||||||||||
| 257 | } | ||||||||||||||||||||||||||||
| 258 | |||||||||||||||||||||||||||||
| 259 | 11 | 1; | |||||||||||||||||||||||||||
| 260 | |||||||||||||||||||||||||||||
| 261 | __END__ | ||||||||||||||||||||||||||||