| 1 | # Prefer numeric version for backwards compatibility | ||||||||||
| 2 | 2 | ▶ | BEGIN { require 5.010_001 }; ## no critic ( RequireUseStrict, RequireUseWarnings ) | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | package Tie::Hash::MultiValueOpts; | ||||||||||
| 7 | |||||||||||
| 8 | 2 | $Tie::Hash::MultiValueOpts::VERSION = 'v1.0.4'; | |||||||||
| 9 | |||||||||||
| 10 | 2 | ▶ | use Tie::Hash (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 2 | ▶ | use parent -norequire, 'Tie::StdHash'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | |||||||||||
| 13 | 4 | ▶ | sub TIEHASH { my $class = shift; bless { @_ }, $class } | ||||||||
|
Subroutine
TIEHASH: called CC=1 SCAR=0.0
| |||||||||||
| 14 | |||||||||||
| 15 | 19 | ▶ | sub STORE { | ||||||||
|
Subroutine
STORE: called CC=3 SCAR=11.0
| |||||||||||
| 16 | 19 | my ( $self, $key, $value ) = @_; | |||||||||
| 17 | |||||||||||
| 18 | 19 | ▶ | if ( my $current_value = $self->{ $key } ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | 7 | ▶ | if ( 'ARRAY' eq ref $current_value ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 20 | 5 | push @{ $current_value }, $value; | |||||||||
| 21 | 5 | return $current_value | |||||||||
| 22 | } | ||||||||||
| 23 | } | ||||||||||
| 24 | 14 | $self->SUPER::STORE( $key, $value ) | |||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | 2 | 1 | |||||||||