This is probably elementary stuff for u guys out there... sorry !! Thanks!!!!#!/usr/bin/perl use Fcntl; #The Module use strict; #my $inp_row="per|l|mo|nks|ro|ck|s"; my $de='|'; print "delim is $de"; #my $count = ($inp_row =~ tr/|//); my $count = ($inp_row =~ tr/$de//); print "count is $count\n";
In reply to Regex - counting number of '|' by perl_junkie
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |