An Introduction to Class::DBI - Bonus Material 48

Class::DBI Gotchas

Collision of Accessor Names

  • What if you have a column in your table named:

    • 'delete'

    • 'search'

    • 'sequence'

    • 'update'

    • .. etc.

  • Override the accessor_name method:

        sub accessor_name {
            my ($class, $column) = @_;
            if ($column eq 'search') {
                $column = 'my_search';
            }
            return $column;
        }
    

 

YAPC::Canada << Previous | Index | Next >>
Copyright © 2003 Michael Graham