thank you so much.it was great.but please give me some explanation about these lines of code.thank you again.
for my $idx (0 .. $#$domain) { my @near = grep {$_ >= 0 && $_ <= $#$domain} $idx - 1, $idx + +1; push @{$neighbours{$domain->[$idx]}}, map {$domain->[$_]} @nea +r; } }
In reply to Re^2: finding neighbors of an element in arrays
by Anonymous Monk
in thread finding neighbors of an element in arrays
by persianswallow
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |