my $heading = q(Lady Aleena's collections); my $collection_file = "$collections_dir/index.txt"; if ( $collection && grep { $collection eq $_ } @collections ) { # I don't like the next line. $heading = q(Lady Aleena's ).lc "$collection collection"; $collection_file = "$collections_dir/$collection.txt"; } $collection_file =~ s/ /_/g; open(my $collection_fh, '<', $collection_file) || die $!;