--- "A. Pagaltzis" <[EMAIL PROTECTED]> wrote: > * Jonathan E. Paton <[EMAIL PROTECTED]> [2002-11-20 20:51]: > > if (@array > $bound) { > > $array[$bound-1] = ", etc"; # Set element at boundary > > $#array = $bound-1; # Shorten array to boundary > > } > > > > print join ", ", @array; > > Again, that's the same as: > > join ', ', @array[0 .. $bound], @array > $bound ? 'etc' : ();
No, it's not. In my way the effects on the array are permanent, although that's probably not useful in this instance - however there is educational value in my solution: $#array # Gives last index of array, can be assigned to # which increases or decreases the number of # elements. They didn't learn anything like that from yours... did they? ;-) Jonathan Paton ===== s''! v+v+v+v+ J r e P h+h+h+h+ !s`\x21`~`g,s`^ . | ~.*``mg,$v=q. P ! v-v-v-v- u l r e r h-h-h- !12.,@.=m`.`g;do{$.=$2.$1,$.=~s`h E ! v+v+v+ s k e h+h+ !`2`x,$.=~s`v`31`,print$.[$v+=$.] R ! v-v- t H a c h h- !}while/([hv])([+-])/g;print"\xA" L ! A n o t !';$..=$1while/([^!]*)$/mg;eval$. __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com