Lines Matching refs:count
492 additional checking of values, etc. Here, we want the C<count>
493 element always to be nonnegative, so we redefine the C<count>
500 struct ( 'MyObj', { count => '$', stuff => '%' } );
502 # override the default accessor method for 'count'
503 sub count {
506 die 'count must be nonnegative' if $_[0] < 0;
507 $self->{'MyObj::count'} = shift;
508 warn "Too many args to count" if @_;
510 return $self->{'MyObj::count'};
515 print "\$x->count(5) = ", $x->count(5), "\n";
516 # prints '$x->count(5) = 5'
518 print "\$x->count = ", $x->count, "\n";
519 # prints '$x->count = 5'
521 print "\$x->count(-5) = ", $x->count(-5), "\n";