in reply to Re: Please help
in thread Please help

The chop() function I only use once here, to remove the line-break character from the user input.
As on many systems the EOL code is two characters long, chop will only remove one and leave you with a "broken" string.

Use chomp to remove the EOL code instead.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

My blog: Imperial Deltronics

Replies are listed 'Best First'.
Re^3: Please help
by tobyink (Canon) on Mar 27, 2012 at 21:41 UTC

    chop is not great at all, but it was in the project brief. :-)

    perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'