1#!/usr/bin/perl -T -w
2
3BEGIN {
4    if( $ENV{PERL_CORE} ) {
5        chdir 't';
6        @INC = '../lib';
7    }
8}
9
10use strict;
11
12use Tie::RefHash;
13
14{
15  package Moose;
16  sub new { bless { }, shift };
17
18  package Elk;
19  our @ISA = "Moose";
20}
21
22$\ = "\n";
23print "1..2";
24
25my $obj = Moose->new;
26
27tie my %hash, "Tie::RefHash";
28
29$hash{$obj} = "magic";
30
31print ( ( $hash{$obj} eq "magic" ) ? "" : "not ", "ok - keyed before rebless" );
32
33bless $obj, "Elk";
34
35print ( ( $hash{$obj} eq "magic" ) ? "" : "not ", "ok - still the same");
36