Skip to content

Instantly share code, notes, and snippets.

@preaction
Created June 7, 2017 17:37
Show Gist options
  • Select an option

  • Save preaction/5bd14f5f25f12641266d5c7dd7042d22 to your computer and use it in GitHub Desktop.

Select an option

Save preaction/5bd14f5f25f12641266d5c7dd7042d22 to your computer and use it in GitHub Desktop.
use v5.24;
use Data::Dumper;
my $hash = { foo => 'bar', fizz => 'buzz' };
say Dumper $hash;
local $hash->@{qw( foo fizz )} = ( 'foo', 'fizz' );
say Dumper $hash;
#local $hash->%{qw( foo fizz )} = ( foo => 'foo', fizz => 'fizz' );
# Can't modify key/value hash slice in local
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment