"Drieux" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >
This discussion goes along with the one you are having with fliptop. > > One of my first question is - why the 'closure' eg: > > { > package FOO; > .... > } > > Or is that simply to make 'clear' that outside of > the Closure it is still package 'main'??? I dont think you can call that a closure yet. You would have to be defining subroutines that refer to lexical variables outside of the subroutine or something along those lines: [EMAIL PROTECTED] trwww]$ perl { my $dog = 'spot'; sub dogsName { my $pooch = $dog; return("my dog is $pooch"); } } print dogsName(), "\n"; print "Share your dog '$dog' with me\n"; Ctrl-D my dog is spot Share your dog '' with me Only the sub dogsName() knows the value of $dog. NOW the braces are a closure for the lexical. Before that they just made up a block. The last line of code above explodes with strict. So, when you do your: > { > package FOO; > .... > } And you define lexicals in there, only functions internal to the block have access to the lexical. If you put each class in its own file, you get the same behavior because files have thier own scope. In OO terms, this is called 'private static members' <snip /> > > Which leads me to my second set of question, > > as a general habit I tend to make 'private-ish' methods > with the "_" prefix such as > > sub _some_private_method { .... } > > is there some 'general access' mechanism by which one can > ask for the LIST of all methods that an 'object' CanDo??? > Or should one have a 'register_of_parser_methods' approach > that one can query? > I followed your link ( that I affectionately snipped ), but it was a couple days ago. If your hell-bent on writing YA_CGI_AppServer, then check out how the currently existing ones handle dispatching. CGI::Application is an excellent example and easy to follow because its simple. There are others, too. I like to write my own application server components because it is fun to see one evolve from an empty text file to set of directories worthy of CVS: http://waveright.homeip.net/~trwww/api.gif But sometimes its funner to pretend everything is a jigsaw puzzle. Making CGI::Application, CGI::Session, Class::DBI, and Template::Toolkit work together transparently has been interesting. Perhaps one day it will be done =0). Todd W. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]