1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
use v5.10; use Data::Dumper; my @remote_things = (1, 2, 4, 6); my @local_things = (5, 3); my %things = map({ state $operation = "-"; if ("|" eq $_) { $operation = "+"; } "|" eq $_ ? () : ($_, $operation) } (@remote_things, "|", @local_things)); say Dumper(\%things);
You can clone a snippet to your computer for local editing. Learn more.