[Maypole] Weird listing if stringify_self specified.

Peter Speltz peterspeltz@yahoo.com
Tue, 2 Nov 2004 09:23:57 -0800 (PST)


I have a person class and on the list it puts the value returned for stringify
self for the mid_name column or first_name column depending on whether i use
the Person::stingify_self method or Person->columns( Stringify=> ..). 

When i take them I get the correct values in the listing. 
Here's what it looks like with Stingify set.

Person ID  First Name     Mid Name       Last Name
--------------------------------------------------
4          Peter       Peter Joe Speltz   Speltz



Here is my person class:

package My::Person;
use Class::Date ();
use strict;
use warnings;

__PACKAGE__->columns('Primary'  => 'prsn_id' );
__PACKAGE__->untaint_columns( printable => [ qw/first_name mid_name last_name/
],
                              date      => [ "dob" ] );

sub stringify_self {  # with this, i get listing above
   my $self = shift; join (" " , ($self->first_name,
   $self->mid_name, $self->last_name) );
}

# With this, mid name is correct in listing above but first name is 
# Peter/Joe/Speltz
#__PACKAGE__->columns('Stringify'    => qw/first_name mid_name last_name/ );

# returns true if prsn is senior citizen
sub is_senior_cit
{
    my $self = shift;
    return 1 if ($self->dob  <= ( Class::Date::now - '65Y' ) );
    return 0;
}

1;

thanks







=====
pjs


		
__________________________________ 
Do you Yahoo!? 
Check out the new Yahoo! Front Page. 
www.yahoo.com