IJKin has asked for the wisdom of the Perl Monks concerning the following question:
I get 5 when I run this: Solaris, Perl 5.8.8 How can I get the TRUE number of fields?use strict; my $tst_str = "1~2~3~4~5~~~~~~~~~~"; my @ray = split(/~/,$tst_str); my $len = scalar(@ray); print "len - $len\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Split returns UPTO last non-blank field
by Perlbotics (Archbishop) on Sep 28, 2011 at 20:55 UTC | |
|
Re: Split returns UPTO last non-blank field
by Anonymous Monk on Sep 28, 2011 at 20:58 UTC |