#!/usr/bin/perl -w use strict; use Foo; my $i = 1; my $bar = 'foo'; my $foo = Foo->new; print "|", $foo->convert(sub {$i; return $bar}), "|\n";