--- loncom/types/Stack.pm 2003/04/18 06:10:47 1.2 +++ loncom/types/Stack.pm 2003/04/24 10:57:57 1.3 @@ -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.3 2003/04/24 10:57:57 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -88,6 +88,16 @@ 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;