in reply to Counting Characters

print scalar split '', $summary; or if you really want to count the number of characters: map {$count++} split '', $summary; print $count;

Of course none of these is efficient, but if you really do not want to use the built-in length function, ...

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

Replies are listed 'Best First'.
Re^2: Counting Characters
by antirice (Priest) on Mar 02, 2006 at 21:30 UTC
    Don't forget about print $summary =~ y///c;.
Re^2: Counting Characters
by GrandFather (Saint) on Mar 02, 2006 at 21:59 UTC

    or counting nibbles and dividing by two (bit fraught for multi-byte characters though):

    use strict; use warnings; my $text = '.'x400; my $summary = substr($text, 0, 500); print length(unpack 'H*', $summary) / 2, "\n";

    Prints:

    400

    DWIM is Perl's answer to Gödel