provide DEMOLISH
[gitmo/Moo.git] / t / global-destruction-helper.pl
diff --git a/t/global-destruction-helper.pl b/t/global-destruction-helper.pl
new file mode 100644 (file)
index 0000000..13d794c
--- /dev/null
@@ -0,0 +1,19 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+no warnings 'once'; # work around 5.6.2
+
+{
+    package Foo;
+    use Moo;
+
+    sub DEMOLISH {
+        my $self = shift;
+        my ($igd) = @_;
+
+        print $igd || 0, "\n";
+    }
+}
+
+our $foo = Foo->new;