SPUG: How can I find @1 - @2?
Michael R. Wolf
MichaelRWolf at att.net
Fri Jan 26 23:28:11 PST 2007
use Set::Scalar; # Set::Object works similarly
my $students = Set::Scalar->new(qw{Manny Moe Jack Jill});
my $enrolled = Set::Scalar->new(qw{Manny Moe});
my $unenrolled_students;
$unenrolled_students = $students->difference($enrolled);
printf "Set::Scalar method: %s\n", join q{, },
$unenrolled_students->members();
$unenrolled_students = $students - $enrolled;
printf "Set::Scalar overloading: %s\n", join q{, },
$unenrolled_students->members();
print <<Limerick;
Jack and Jill
Went up the hill
To fetch a pail of water.
Jill forgot to take the pill,
And now they have a daughter!!!
Limerick
--
Michael R. Wolf
All mammals learn by playing!
MichaelRWolf at att.net
More information about the spug-list
mailing list