in reply to Pattern Substitution..

Remember that pattern matches, by default, are *greedy*, so they match the longest string that conforms to the pattern. And unless you specify 'g' on the end, they only match the first substring that matches the pattern you specify.

So s/o*/e/ matches the first instance of "0 or more 'o's", and guess where that is? Right at the beginning of the string. When it says "match 0 or more", it means it =) So the result is "egood food".

With your second example, it only matches the first substring that's one or more 'o's, (the 'oo' in "good"), and replaces that with a single 'e' => 'ged food'.

HTH

perl -e 'print "How sweet does a rose smell? "; chomp ($n = <STDIN>); +$rose = "smells sweet to degree $n"; *other_name = *rose; print "$oth +er_name\n"'