in reply to Improving a palindrome script...

Hi chinamox,

I would not call those major challenges ...

To test whether a string $str is 4 or more characters:

if (length($str) >= 4) { # ... }

To convert a string $str to lowercase (without "resorting to a regex"):

my $lower = lc $str;

Is that what you need?


s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/

Replies are listed 'Best First'.
Re^2: Improving a palindrome script...
by chinamox (Scribe) on Oct 24, 2006 at 19:02 UTC

    Thanks for those two little chunks of code! I am still quite new to Perl so these arn't really known to me yet. This is also why regexs still give me the willys!

    -mox
      Perl's functions are listed in perlfunc. They are grouped in categories, so you should have been able to find your answers very fast.