#!/usr/bin/perl -w use Food; use Cookware; use strict; my $roll = new Food('roll'); $roll->cut_in(2); for (@{$roll->parts}) { $_->add_item('cheese') } $roll->cook(-method => 'grill'); my $egg = new Food('egg'); $egg->crack( -into => Cookware::frypan ); $egg->cook( -method => 'fry', -using => $egg->cracked_into ); $egg->wait_for_done && $roll->stop_cooking; ## wait_for_done implies $egg->stop_cooking $roll->parts[0]->add_item($egg); $roll->reassemble; $roll->consume; print "Mmm... tasty" if ($roll->was_eaten && $roll->was_tasty); #Digest Roll patch by thor, with minor mods $roll->use('Digest::MD5'); $roll->{MD5}->digest;