Hi I have a Resultsource class as follows:
######################################## package myDB::Atable; use base qw/ DBIx::Class /; __PACKAGE__->load_components( qw/ PK::Auto Core / ); __PACKAGE__->table( 'atable' ); __PACKAGE__->add_columns( acolumn => {} ); __PACKAGE__->mk_group_ro_accessors( 'simple' => qw/ aCalculatedField / ); sub get_simple { my ( $self, $key ) = @_; if ( $key eq 'aCalculatedField' ) { return 'CALC: '.String::Util::trim( $self->acolumn ); } } ######################################## So now I can query Atable and get the columns 'acolumn' and 'aCalculatedfield'. the column 'acolumn' will be returned by: $row->get_column('acolumn') the calculated column will be returned by: $row->get_simple('aCalculatedfield') However, the code doesn't work if I put a 'use String::Util;' at the top of the package and replace 'String::Util::trim' by 'trim'. It looks like the declaration gets out of scope. How can I keep this code clean ? -- erik colson _______________________________________________ List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk