--- loncom/types/Stack.pm 2003/04/18 06:10:47 1.2 +++ loncom/types/Stack.pm 2003/04/24 15:12:40 1.4 @@ -1,6 +1,6 @@ # Implement a simple stack in terms of a list. # -# $Id: Stack.pm,v 1.2 2003/04/18 06:10:47 albertel Exp $ +# $Id: Stack.pm,v 1.4 2003/04/24 15:12:40 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -88,6 +88,19 @@ sub pop { return pop(@$self); } +=pod + +=head 1 + + Returns the number of items on the stack. + +=cut + +sub Count { + my $self = shift; + my $elements = scalar(@$self); + return $elements; +} 1;