my $str = "this is a test string"; my $cnt = 1; # num tokens = whitespace + 1 ++$cnt while $str =~ /\s+/g; print $cnt, "\n"; # prints 5
-- Tanalis
#include www.liquidfusion.org.uk
In reply to Re: Counting the number of items returned by split without using a named array
by Tanalis
in thread Counting the number of items returned by split without using a named array
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |