#!/usr/bin/perl
use strict;
use warnings;
my @readingbooks = ("a b", "c d", "e f", "g h");
my @readingdate = (1991, 1992, 1993, 1994);
my @catbooks = ("one", "two", "three", "client's", "five", "six", "seven", "eight", "a b");
my @catdate = (1980, 1981, 1982, 1994, 1984, 1985, 1986, 1987, 1991);
my $rdbooks; my $rddate; my $cataloguebooks; my $cataloguedate;
for (0..$#readingbooks){
$rdbooks = $readingbooks[$_];
$rddate = $readingdate[$_];
for (0..$#catbooks){
$cataloguebooks = $catbooks[$_];
$cataloguedate = $catdate[$_];
if (($rdbooks eq $cataloguebooks) && ($rddate == $cataloguedate)) {
print "$rdbooks \t $cataloguebooks \n";
print "$rddate \t $cataloguedate \n";
print "wow \n\n";
}
}
}
####
for my $i (0..$#readingbooks){
for my $j (0..$#catbooks){
if (($readingbooks[$i] eq $catbooks[$i])...
####
#!/usr/bin/perl
use strict;
use warnings;
my @readingbooks = ("a b", "c d", "e f", "g h");
my @readingdate = (1991, 1992, 1993, 1994);
my %readingbooks_hash;
$readingbooks_hash{$_}++ for @readingbooks;
my %readingdate_hash;
$readingdate_hash{$_}++ for @readingdate;
my @catbooks = ("one", "two", "three", "client's", "five", "six", "seven", "eight", "a b");
my @catdate = (1980, 1981, 1982, 1994, 1984, 1985, 1986, 1987, 1991);
for my $i (0 .. $#catbooks) {
if ($readingbooks_hash{$catbooks[$i]} and $readingdate_hash{$catdate[$i]}) {
print "$catbooks[$i]\t$catdate[$i]\n";
print "wow \n\n";
}
}