Many will not understand the perlsecret, Goatse; those that do may wish they didn't. All you really need is:
$PipeCounter = y/|/|/;
See also perlfaq4 How can I count the number of occurrences of a substring within a string? - which politely avoids the word goatse by creatively describing the code, without evoking a hard-to-forget mental picture, as a global match in list context ;-)
In reply to Re^2: Count number of characters in a DATA block
by eyepopslikeamosquito
in thread Count number of characters in a DATA block
by Trudge
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |