Bifid cipher: Difference between revisions

m
→‎{{header|Perl}}: additional polishing
m (→‎{{header|Perl}}: consolidate two lists into a single array)
m (→‎{{header|Perl}}: additional polishing)
Line 187:
for my($k,$v) (%P) { $I{$v} = $k }
for my ($n,$char) (indexed split '', ($text =~ s/\s//gr)) {
for my($im,$ji) (indexed split ' ', $P{$char}) { $c[0$m][$n] = $i; $c[1][$n] = $j }
}
for my($i,$j) (@$c[1]->@*, @$c[0]->@*) { $encrypted .= $I{"$j $i"} }
$encrypted
}
2,392

edits