hamid.afshar has asked for the wisdom of the Perl Monks concerning the following question:

Hi dear monks,

I am running:

sudo perl -MDBIx::Class::Schema::Loader=make_schema_at,dump_to_dir:./lib -e 'make_schema_at("Timesheets::Schema", { debug => 1 }, [ "dbi:mysql:dbname=timesheets","root", "" ])'

Which is meant to create a dbix schema for me. However i get this error:

Timesheets::Schema::Result::User->set_primary_key("id"); Failed to reload class Timesheets::Schema::Result::Template: Illegal a +ccessor name '1_start'. If you want CAG to attempt creating it anyway + (possible if Sub::Name is available) set $ENV{CAG_ILLEGAL_ACCESSOR_N +AME_OK} at /usr/local/share/perl/5.14.2/DBIx/Class/ResultSourceProxy. +pm line 34. Compilation failed in require at (eval 146) line 2.
Please rescue me! Thank you Hamid

Replies are listed 'Best First'.
Re: DBIx::Class get error when running make schema
by Your Mother (Archbishop) on Jan 22, 2013 at 17:06 UTC

    It sounds like you have columns named with leading numbers. This is an "illegal" sub name in perl though it can be worked around. It's not a good idea probably. You can either follow the advice in the warning or manually write an accessor with a safer name if you don't want to rename your column but that second options means writing the classes from scratch since the loader won't work.