| 1 | package Magpie::Util; | ||||||||||
| 2 | 49 | $Magpie::Util::VERSION = '1.141660'; | |||||||||
| 3 | # ABSTRACT: Common utility functions | ||||||||||
| 4 | |||||||||||
| 5 | #------------------------------------------------------------------------------- | ||||||||||
| 6 | # internal convenience for regularizing potentially uneven lists of name/param | ||||||||||
| 7 | # hash pairs | ||||||||||
| 8 | #------------------------------------------------------------------------------- | ||||||||||
| 9 | sub make_tuples { | ||||||||||
| 10 | 122 | ▶ | my @in = @_; | ||||||||
|
Subroutine
make_tuples: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||
| 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 | 49 | 1; | |||||||||
| 24 | |||||||||||
| 25 | __END__ | ||||||||||
| 26 | =pod | ||||||||||
| 27 | |||||||||||
| 28 | =head1 NAME | ||||||||||
| 29 | |||||||||||
| 30 | Magpie::Util - Common utility functions | ||||||||||
| 31 | |||||||||||
| 32 | =head1 VERSION | ||||||||||
| 33 | |||||||||||
| 34 | version 1.141660 | ||||||||||
| 35 | |||||||||||
| 36 | =head1 AUTHORS | ||||||||||
| 37 | |||||||||||
| 38 | =over 4 | ||||||||||
| 39 | |||||||||||
| 40 | =item * | ||||||||||
| 41 | |||||||||||
| 42 | Kip Hampton <kip.hampton@tamarou.com> | ||||||||||
| 43 | |||||||||||
| 44 | =item * | ||||||||||
| 45 | |||||||||||
| 46 | Chris Prather <chris.prather@tamarou.com> | ||||||||||
| 47 | |||||||||||
| 48 | =back | ||||||||||
| 49 | |||||||||||
| 50 | =head1 COPYRIGHT AND LICENSE | ||||||||||
| 51 | |||||||||||
| 52 | This software is copyright (c) 2011 by Tamarou, LLC. | ||||||||||
| 53 | |||||||||||
| 54 | This is free software; you can redistribute it and/or modify it under | ||||||||||
| 55 | the same terms as the Perl 5 programming language system itself. | ||||||||||
| 56 | |||||||||||
| 57 | =cut | ||||||||||
| 58 | |||||||||||