[Dbix-class] RFC: Possibly cleaner output for DBIC::Schema::Loader dumps

Nilson Santos Figueiredo Junior acid06 at gmail.com
Fri Jul 21 17:58:38 CEST 2006


On 7/21/06, Brandon Black <blblack at gmail.com> wrote:
> I'm not sure how I feel on this.  I haven't ever noticed this
> technique before.  My gut feeling is that I don't particularly like
> it, even though it does free up some line length.  I suspect there are
> cases where $pkg just can't replace __PACKAGE__, although probably not
> in this set of output :)

I only use it on my schema classes, where usually you'll have a lot of
__PACKAGE__ statements and its "format" won't change a lot.

> I don't actually use Schema::Loader on my own projects anymore, and
> haven't in quite some time, so I don't really have much personal stake
> in these things.

Well, I currently use Schema::Loader for its code generation
abilities. Due to my database modeling background I'm *really* used to
creating/altering tables using a visual tool. Thus, it's something
pretty handy for me if I'm able to create some tables on the database
and then have myapp_create.pl generate the schema classes. In fact, I
only really started using Schema::Loader recently, when I looked at a
more recent version and found out about "create=static".

> Things like using qw// where appropriate, and single-quotes where
> appropriate too.  Then again, I feel anyone who cares that much will
> probably just do a series of mechanical cleanups on their own source
> after generating.

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'll see if I can came up with two separate patches later: one with
line breaks and comments and another with __PACKAGE__  -> $pkg change.
And then you choose if you'll apply anything at all be either both of
them or only the line breaks + comments one.

-Nilson Santos F. Jr.



More information about the Dbix-class mailing list