Skip to content

Instantly share code, notes, and snippets.

@jettero
Last active December 15, 2015 19:19
Show Gist options
  • Select an option

  • Save jettero/5310130 to your computer and use it in GitHub Desktop.

Select an option

Save jettero/5310130 to your computer and use it in GitHub Desktop.
package dumb_thing;
use strict; use warnings;
use Tie::Array;
use Carp;
use base 'Tie::StdArray';
sub TIEARRAY {
my $class = shift;
my $this = bless [], $class;
my $that = shift;
@$this = @$that;
$this;
}
package main;
use strict; use warnings;
use Storable qw(freeze thaw);
my $x = [1,2,3,4];
broken($x); # works fine around the world
broken( thaw( freeze($x) ) ); # broken in 5.16 and 5.17
sub broken {
my $w = shift;
tie @$_, dumb_thing => $_ for $w;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment