sub output_path {    my ($self, $head) = @_;    ### Get the output directory:    my $dir = $self->output_dir($head);        ### Get the output filename, decoding into the local character set:    my $fname = unmime $head->recommended_filename;    ### Can we use it:    if    (!defined($fname)) { $self->debug("no filename recommended: synthesizing our own"); $fname = $self->output_filename($head);    }    elsif ($self->ignore_filename) { $self->debug("ignoring all external filenames: synthesizing our own"); $fname = $self->output_filename($head);    }    elsif ($self->evil_filename($fname)) { ### Can we save it by just taking the last element? my $ex = $self->exorcise_filename($fname); if (defined($ex) and !$self->evil_filename($ex)) {    $self->whine("Provided filename '$fname' is regarded as evil, ", "but I was able to exorcise it and get something ", "usable.");    $fname = $ex; } else {    $self->whine("Provided filename '$fname' is regarded as evil; ", "I'm ignoring it and supplying my own.");    $fname = $self->output_filename($head); }    }    $self->debug("planning to use '$fname'");    ### Resolve collisions and return final path:    return $self->find_unused_path($dir, $fname); }