Skip to content

Instantly share code, notes, and snippets.

@SebDeclercq
Last active August 29, 2015 14:07
Show Gist options
  • Save SebDeclercq/ad3aa1e514a493e4689d to your computer and use it in GitHub Desktop.
Save SebDeclercq/ad3aa1e514a493e4689d to your computer and use it in GitHub Desktop.
#! /usr/bin/perl -w
use strict;
use warnings;
use feature 'say';
use experimental 'postderef';
use Data::Dumper;
my $ref = [ { 'az' => 'er', 'ty' => 'uiop', },
[ 1..12 ],
'Hello World',
{ 'bz' => [ 'a'..'g' ], 'cv' => { 'azerty' => 'uiop' }, },
'Test',
[ qw/foo bar baz/ ],
];
say "OLD\t", join $", @{%{@$ref[3]}{bz}};
say "NEW\t", join $", $$ref[3]{bz}->@*;
say "OLD\t", $_.' => '.%{@$ref[0]}{$_} for sort keys %{@$ref[0]};
say "NEW\t", $_.' => '.$$ref[0]{$_} for sort keys $$ref[0]->%*;
say "OLD\t", join $", @{$$ref[5]};
say "NEW\t", join $", $$ref[5]->@*;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment