summaryrefslogtreecommitdiffstats
path: root/MDK/Common/DataStructure.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-07-24 22:58:36 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-07-24 22:58:36 +0000
commit72e28b71c097e4f2b17b031416790090cefb8263 (patch)
tree7d76b1106d53506122086b57a1cfda99af714fa0 /MDK/Common/DataStructure.pm
parent5bef71a0c86613f95e154d08b5f8f0cc23226e27 (diff)
downloadperl-MDK-Common-72e28b71c097e4f2b17b031416790090cefb8263.tar
perl-MDK-Common-72e28b71c097e4f2b17b031416790090cefb8263.tar.gz
perl-MDK-Common-72e28b71c097e4f2b17b031416790090cefb8263.tar.bz2
perl-MDK-Common-72e28b71c097e4f2b17b031416790090cefb8263.tar.xz
perl-MDK-Common-72e28b71c097e4f2b17b031416790090cefb8263.zip
everything should work now
Diffstat (limited to 'MDK/Common/DataStructure.pm')
-rw-r--r--MDK/Common/DataStructure.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/MDK/Common/DataStructure.pm b/MDK/Common/DataStructure.pm
index 8619e03..afc4ae1 100644
--- a/MDK/Common/DataStructure.pm
+++ b/MDK/Common/DataStructure.pm
@@ -1,6 +1,7 @@
package MDK::Common::DataStructure;
use MDK::Common::Math;
+use MDK::Common::Func;
use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK);
@@ -35,8 +36,12 @@ sub next_val_in_array {
sub list2kv {
- [ grep_index { MDK::Common::Math::even($::i) } @_ ],
- [ grep_index { MDK::Common::Math::odd($::i) } @_ ];
+ my (@k, @v);
+ for (my $i = 0; $i < @_; $i += 2) {
+ push @k, $_[$i + 0];
+ push @v, $_[$i + 1];
+ }
+ \@k, \@v;
}
1;