#!/usr/local/bin/perl use strict; use warnings; { package Dummy; sub new { bless $_[1], $_[0] } sub DESTROY { warn "($_[0])" } } { my $fact; $fact = sub{ $_[0] <= 1 ? $_[0] : $_[0] * $fact->($_[0] - 1) }; bless $fact, 'Dummy'; print $fact->(10), "\n"; } warn "Goodbye, world!";