Frequently Asked Questions
Perl homework 2
- Is it safe to assume that the only illegal puctuation will come
at the beginning or end of a word?
No, this is not a valid assumption. Illegal characters may occur
anywhere within a word, and must be removed. Further, a single word
can contain multiple illegal characters, all of which must be
removed.
- Why does my sorting algorithm work with Perl 5.8.0 on my own
computer, but not with 5.6.1 on RCS?
sort() was completely re-written in version 5.8.0. In
particular, it is now "stable", meaning that items which
have the same sorting precedence are guaranteed to stay in the same
order they were in before the sort. This is not true of versions
prior to 5.8.0, including 5.6.1. For more information, see the
v5.8.0 perldelta. This
is a reminder that your code
must work on rcs-sun1.rpi.edu using Perl 5.6.1
- If the input contains "foo.bar", should we treat that
as the single word "foobar", or as the two words
"foo" and "bar"?
Treat it as the single word "foobar"
- What do we do about words which differ by only a capital
vs. lowercase letter? (ie,
"Hello" vs
"HeLLo")?
These should be counted as seperate and distinct words. Each of the
above two words should be printed in your Starting Capitals list and
in your Duplicate Letter list with a frequency of one each.
However - see the next question.
- For the adjacent vowels and duplicate letters, does case
matter?
No. The word HelLo should be in your duplicate letters list, and the
word YoU should be in your adjacent vowels list.