| 1 | package Magpie::Util; | ||||||||||
| 2 | 50 | $Magpie::Util::VERSION = '1.163200'; | |||||||||
| 3 | # ABSTRACT: Common utility functions | ||||||||||
| 4 | |||||||||||
| 5 | #------------------------------------------------------------------------------- | ||||||||||
| 6 | # internal convenience for regularizing potentially uneven lists of name/param | ||||||||||
| 7 | # hash pairs | ||||||||||
| 8 | #------------------------------------------------------------------------------- | ||||||||||
| 9 | 122 | ▶ | sub make_tuples { | ||||||||
|
Subroutine
make_tuples: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||
| 10 | 122 | my @in = @_; | |||||||||
| 11 | 122 | my @out = (); | |||||||||
| 12 | 122 | ▶ | for (my $i = 0; $i < scalar @in; $i++ ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 13 | 528 | ▶ | next if ref( $in[$i] ) eq 'HASH'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 14 | 391 | my $args = {}; | |||||||||
| 15 | 391 | ▶ | if ( ref( $in[$i + 1 ]) eq 'HASH' ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | 135 | $args = $in[$i + 1 ]; | |||||||||
| 17 | } | ||||||||||
| 18 | 391 | push @out, [$in[$i], $args]; | |||||||||
| 19 | } | ||||||||||
| 20 | 122 | return @out; | |||||||||
| 21 | } | ||||||||||
| 22 | |||||||||||
| 23 | 50 | 1; | |||||||||
| 24 | |||||||||||
| 25 | __END__ | ||||||||||