Snippets

Brian Medley XoGxa: Untitled snippet

Created by Brian Medley
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);

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.