AlexBausW: Zeichen zählen

Beitrag lesen

Hallo Frank,

tr/<//;
Sorry, funktioniert tatsächlich. War das schon immer so?

[...]

Das ist eine "Eigenschaft" von tr//;

Aus der Doku:

If the REPLACEMENTLIST is empty, the SEARCHLIST is replicated. This latter is useful
for counting characters in a class or for squashing character sequences in a class.

Und das Beispiel:

$cnt = tr/0-9//;  # count the digits in $_

Gruß AlexBausW

Please visit my SELFvisitingcard @ http://www.atomic-eggs.com/selfspezial/daten/150.html