Your problem is that you're doing an exact match (with eq) against the alphabetic characters but not the terminal newline. For example, if I type in jaccard, then $metric will be the string "jaccard\n". You should probably chomp the input prior to processing it, e.g.
my $metric = <>;
chomp $metric;
Example of your code as posted:
Which Metric jaccard or Bleu:jaccard
Which source title or snippet or url:title
bleu not called
Example after chomping $metric and $source:
Which Metric jaccard or Bleu:jaccard
Which source title or snippet or url:title
in title
P.S. I also notice you prompt for "Bleu" but test for "bleu": these strings are not equal.
|