On Mon, 29 Apr 2002, Paul Makepeace wrote: > Can someone remind me why the tmp var is needed in something like, > > my $q = new CGI; > sub popup_menu_factory { sub { my @tmp=@_; $q->popup_menu(@tmp) } } > > (I'm trying to hack some form persistence with HTML::Template)
It's not needed. It's probably code that was originally written as my $q = new CGI; sub popup_menu_factory { my @tmp = @_; sub { $q->popup_menu(@tmp) }} This meaning that we get closure like behavior, do you could do my $popup = popup_menu_factory(@arguments); ...later... print $popup->() . " select an option " . $popup->(); Later. Mark. -- s'' Mark Fowler London.pm Bath.pm http://www.twoshortplanks.com/ [EMAIL PROTECTED] ';use Term'Cap;$t=Tgetent Term'Cap{};print$t->Tputs(cl);for$w(split/ +/ ){for(0..30){$|=print$t->Tgoto(cm,$_,$y)." $w";select$k,$k,$k,.03}$y+=2}