promise(\ my $result_of_long_compute, sub { # Long computation here }); #### sub promise { my ($to_tie, $implement, $opts); if (UNIVERSAL::isa($to_tie, 'SCALAR')) { tie $$to_tie, Data::Lazy, $implement, $opts; } elsif (UNIVERSAL::isa($to_tie, 'HASH')) { ... }