#!/usr/bin/env perl

use v5.10.0;
use warnings;
use strict;

use Backpack;
use Items;

my $bag = Backpack->new(color => 'red');

say "The bag is a ", $bag->color, ' ', $bag->name, '.';

$bag->add_items(
  Candle->new,
  Spellbook->new,
  Sandwich->new,
);

say "It weighs ", $bag->weight, "kg.";
say "Contents:";
say "  ", $_->name, " (weight: ", $_->weight, "kg)"
  for($bag->contents);
