in reply to Re^2: Count Using Split
in thread Count Using Split

No, because if one occurence of the search string is found, the string is split into two.

Then  my @t=split(/mapping id="/,$_); should be  my @t = /mapping id="/g; instead.

    :-)

Replies are listed 'Best First'.
Re^4: Count Using Split
by ikegami (Patriarch) on Sep 17, 2008 at 19:07 UTC
    Having an array of identical elements is rather useless. The only thing you can do is count them. Why not get the count from the start.
    my $t = () = /mapping id="/g;