#!/usr/bin/perl

# Retrieve Set::Scalar from http://www.perl.com/CPAN/modules/by-module/Set
use Set::Scalar;  

my $metal    = Set::Scalar->new( 'tin',     'gold', 'iron' );
my $precious = Set::Scalar->new( 'diamond', 'gold', 'perl' );

print "union(Metal, Precious)        = ",
      $metal->union($precious), "\n";
print "intersection(Metal, Precious) = ",
      $metal->intersection($precious), "\n";

# union(Metal, Precious)        = (diamond gold iron perl tin)
# intersection(Metal, Precious) = (gold)

print "Metal + Precious = ", $metal + $precious, "\n";
print "Metal * Precious = ", $metal * $precious, "\n";
