On Wed, 2005-11-30 at 00:13 -0500, Ron Newman wrote:
> On Nov 30, 2005, at 12:03 AM, Federico Lucifredi wrote:
> 
> > my $maxlen = 4;
> >
> > my @indices = (0, 0, 0, 0); # how do I init this array so that it is
> > $maxlen zeros long ?
> 
humm, that would give me a single element in $indices[0] equal to
"0000", while what we really want is @indices[0..3] = (0,0,0,0)...
except, of $maxlen length :)

> my @indices = 0 x $maxlen;
> 
> 
> >        unless (++$i == $maxlen)
> >        { last; } # can we get rid of some braces somehow ?!
> 
> last unless (++$i == $maxlen);

good one!

/me goes to bed 

 -f






 
_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to