#!/usr/bin/perl use strict; use warnings; use kitchen qw(kitchenSink); #imports kitchen stuff we need my $sink = new kitchenSink; my @dirties = kitchenSink->get('DIRTIES'); #get all dirty dishes and other utensils if(@dirties) { #there're dirty dishes! my @tub = new $sink->tub; #cleaning tub my @clean = new $sink->dryrack; push(@tub, $sink->liquid_soap); push(@tub, $sink->faucet(water('HOT'))); push(@tub, $sink->brush); while(@dirties) { push(@tub, shift @dirties ); while(dirty($tub[-1])) { clean($tub[-1]) } push(@clean, pop @tub ); #add to dry rack } while(@clean) { put_away($_, getLocation($_)); #returns cleaned item, involves $dryingCloth } } print "We're done!\n";