in reply to Re: •Re: find real length of an array
in thread find real length of an array

This has nothing to do with array behaviour in general, but solely with the way split behaves. Note that if you really want to conserve all trailing fields, instead of passing 99999, you should give it -1. This is documented in perlfunc:
If LIMIT is specified and positive, splits into no more than that many fields (though it may split into fewer). If LIMIT is unspecified or zero, trailing null fields are stripped (which potential users of pop would do well to remember). If LIMIT is negative, it is treated as if an arbitrarily large LIMIT had been specified.

Makeshifts last the longest.

Replies are listed 'Best First'.
Re: Re^3: find real length of an array
by hackmare (Pilgrim) on Mar 16, 2003 at 22:37 UTC

    Aristotle,

    Thanks for the '-1' pointer. I wasn't aware of it.

    I still have to check my coriginal code because with it I am splitting with a large limit value but am still having the issue of misrepresented array size for arrays generated by split. I will look into my code this AM and report back to the monks to clarify what I find to be the source (programmer -me- error or odd behaviour).

    Clearly probabilities lean towards the former.

    hackmare.