Home
Random
Nearby
Log in
Settings
Donate Now
If Wikipedia is useful to you, please give today.
About Wikipedia
Disclaimers
Search
Aggregate pattern: Difference between revisions
Article
Talk
Language
Watch
View history
Edit
Browse history interactively
← Previous edit
Next edit →
Content deleted
Content added
Visual
Wikitext
Revision as of 19:51, 17 October 2007
edit
85.64.223.116
(
talk
)
Minor change
← Previous edit
Revision as of 19:53, 17 October 2007
edit
undo
85.64.223.116
(
talk
)
Another minor change
Next edit →
Line 31:
<source lang="perl">
package Cart::Basket;
@ISA = qw(Cart::Item);
sub query_price {
my $self = shift;
my $contents = $self->{contents};
foreach my $item (@$contents) {
}
}
}
# other query_ routines here...
sub add_item {
my $self = shift;
my $contents = $self->{contents};
my $item = shift; $item->isa('Cart::Item') or die;
push @$contents, $item;
return 1;
}
</source>