in reply to get last characters out of string?

You want to get a substring, but you don't want to use substr? That's almost as inane as the people that periodically show up posting who want to iterate over the contents of an array but not use foreach or map or while.

I mean you certainly could use substr, but why be explicit when you can obtusely use /(.{1-60})$/ instead.

Replies are listed 'Best First'.
Re^2: get last characters out of string?
by ikegami (Patriarch) on May 03, 2006 at 23:48 UTC

    Maybe he thought he had to do

    my $start = length($str) - 60; $start = 0 if $start < 0; $substr = substr($str, $start);

    and was looking for a simpler right function? True, he should have read the docs closer, but *understanding* the docs can sometimes be hard.