my $code =<<'CODE'; print shift || "Foo"; print "\n"; CODE my $coderef = eval"sub{$code}";