in reply to how to shorten given string?

Here are two solutions:
$_ = "Ipod batteries for Apple Ipod PDAs. Replacement batteries from L +aptops for Less.com.url"; print substr ($_, 0, 20); /^(.{0,20})/; print $1;
Boris