#!/usr/bin/perl use warnings; use strict; my @Array_1 = qw(a1 a2 a3 a4 a5 a6); my @Array_2 = qw(a1 b2 c3 a4 f5 a6); my @Array_3 = qw( 1 2 3 4 5 6); # convert to hashes my (%h1, %h2, %h3); undef @h1{@Array_1}; my @idxs = 1 .. @Array_1; @h2{@Array_2} = @idxs; @h3{@idxs} = @Array_3; # do the calculations my %h_tmp = %h2; delete @h_tmp{@Array_1}; delete @h2{keys %h_tmp}; # output ($,, $\) = (' ', "\n"); print keys %h2; print @h3{values %h2};
In reply to Re: Match speed of R in array procesing
by choroba
in thread Match speed of R in array procesing
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |