On 7/21/06, Nilson Santos Figueiredo Junior <[EMAIL PROTECTED]> wrote: > Well, I still think that trying to improve it somehow will at least > make it an easier task to cleanup. I think the current output is > pretty sane. I just, honestly, truly, hate __PACKAGE__. It's probably > the ugliest thing in Perl, IMO. But, of course, this is just a > personal aesthetic preference. ;-)
I don't really know the history, but I suspect the perl guys got the idea for it from Standard C's __FILE__ and __LINE__ etc which are used for debugging/exception messages mostly, to identify the source file/line the problem occurs in. I agree though that it shouldn't be something that's used in everyday code like it is, but that's how it has to be done in perl, and its a pretty widely understood idiom. Start mucking about with "$pkg = __PACKAGE__" in code you're generating for $joe_random_user, and I bet we end up with a bug report that gets tracked down to the guy changing $pkg halfway down the file or something, or we get people confused as to why the idiom is being done differently, and wondering what magic is going on behind the curtains, etc. All for a bit of visual improvement. I say if people want to do things like this to the output, they're welcome to "perl -pi -e 's/.../../' *.pm" or whatever. I would say its probably not a bad idea to throw in a hook for customizing the output, like a config option "dump_substitutions" that allows one to specify regexes to transform the output before it hits the file. However, while it would be easy to use this from a custom script which is calling make_schema_at directly, it would be difficult and ugly to expose this all the way through to myapp_create.pl. -- Brandon _______________________________________________ List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class Wiki: http://dbix-class.shadowcatsystems.co.uk/ IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/ Searchable Archive: http://www.mail-archive.com/[email protected]/
