in reply to Re: I am now slice-aware
in thread I am now slice-aware

You're missing the fact that split /:/ throws away any empty elements at the end of the string.

Try this:

$_ = '1:2:3:::::'; my @a = split /:/; print scalar @a; # prints 3
--
<http://www.dave.org.uk>

"Perl makes the fun jobs fun
and the boring jobs bearable" - me

Replies are listed 'Best First'.
Re: Re: Re: I am now slice-aware
by frankus (Priest) on Apr 17, 2001 at 19:10 UTC

    Just GREAT davorg!, now I have to go and amend my existing code. Wadda way to starta da week, if you want to snigger at my clumsier way:
    @foo=split/:/;<br> for ($#foo..$required_amt){push @foo, undef}
    Thanks to birdbrane for sharing :0).

    --
    
    Brother Frankus.