in reply to Unique Character

Kenosis has given you some clues (using a hash) on how to count each different character. For the total character count, your approach:
my $cnt = @{[$str =~ /./sg]};
probably works, but seems too complicated (and slow, when that matters). Take a look a the length function.

Replies are listed 'Best First'.
Re^2: Unique Character
by Kenosis (Priest) on Feb 01, 2014 at 20:10 UTC

    Indeed, length would be the most straight forward here.