my @our_arguments_are_safe =split /:/, ':';
print scalar @our_arguments_are_safe;
is it ok?
$p = "::"; @m = ($p =~ /(:)/g);
mm, why now do u count separators?
the 'no-code' question was:
why do split consider all empty fields as trailing when he find a list of two?
| [reply] [d/l] [select] |
I think the answer to your question is in this paragraph of the docs.
Empty leading (or trailing) fields are produced when there are positive width matches at the beginning (or end) of the string; a zero-width match at the beginning (or end) of the string does not produce an empty field.
I say I think, because, even with the example given, I find it quite difficult to interpret that sentence. Especially in the light of a couple of other sentances
By default, empty leading fields are preserved, and empty trailing ones are deleted.
and
If LIMIT is unspecified or zero, trailing null fields are stripped
and
Note that splitting an EXPR that evaluates to the empty string always returns the empty list, regardless of the LIMIT specified.
Not at all clear to me:)
Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller
If I understand your problem, I can solve it! Of course, the same can be said for you.
| [reply] |