I am having an issue using split to count instances of a pattern. I was told that I could use the code below to do it but the only output that I'm getting is "-1-1-1-1-1-1-1-1-1-1". I know it's something simple that I'm doing wrong but I just can't see it. If anyone has a suggestion, I would greatly appreciate it.
open (IN, "c:/work/XML_Count/14.xml") || die "Cannot open 14.xml"; while (<IN>){ chomp; my @t=split(/mapping id="/,$_); print $#tt; } close IN;
In reply to Count Using Split by de2425
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |