Ah, but it could be <grin>, its just a question of when you want $arg1 and $arg2 defined... maybe kael wanted the args declared when $a is declared....
sub func{
die 'func takes 2 args' unless 2 == @_;
my ( $arg1, $arg2 ) = @_;
return sub { somesub($arg1,$arg2) if($joe) }
}
$a=&func( $somearg, $someotherarg );
# do stuff..
# call the function
&$a;