| 1 | # | ||
| 2 | # This file is part of Jedi | ||
| 3 | # | ||
| 4 | # This software is copyright (c) 2013 by celogeek <me@celogeek.com>. | ||
| 5 | # | ||
| 6 | # This is free software; you can redistribute it and/or modify it under | ||
| 7 | # the same terms as the Perl 5 programming language system itself. | ||
| 8 | # | ||
| 9 | package Jedi::Helpers::Hash; | ||
| 10 | |||
| 11 | # ABSTRACT: Jedi Helpers for Hash | ||
| 12 | |||
| 13 | 9 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | 9 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | |||
| 16 | 9 | our $VERSION = '1.006'; # VERSION | |
| 17 | |||
| 18 | 9 | ▶ | use Import::Into; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 19 | 9 | ▶ | use Module::Runtime qw/use_module/; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 20 | |||
| 21 | sub import { | ||
| 22 | 8 | ▶ | my $target = caller; |
|
Subroutine
import: called CC=1 SCAR=0.0
| |||
| 23 | 8 | use_module('autobox')->import::into( $target, HASH => __PACKAGE__ ); | |
| 24 | 8 | return; | |
| 25 | } | ||
| 26 | |||
| 27 | sub to_arrayref { | ||
| 28 | 59 | ▶ | my ($headers) = @_; |
|
Subroutine
to_arrayref: called CC=3 SCAR=11.0
Pod
documented
| |||
| 29 | 59 | my @res; | |
| 30 | 59 | for my $k ( keys %$headers ) { | |
| 31 | 2 | for my $v ( @{ $headers->{$k} } ) { | |
| 32 | 3 | push @res, $k, $v; | |
| 33 | } | ||
| 34 | } | ||
| 35 | 59 | return \@res; | |
| 36 | } | ||
| 37 | |||
| 38 | 9 | 1; | |
| 39 | |||
| 40 | __END__ | ||