On Fri, Nov 09, 2007 at 11:13:54PM -0600, Ron Johnson wrote: > On 11/09/07 22:40, Ken Irving wrote: > [snip] > > Greatest thing since > > > > $ perl -e '@b=split //,"bread"; print @b[0,1,2,3,4,5], "\n"' > > Is this supposed to print out b-r-e-a-d or > b > r > e > a > d
No, just "bread" on a line, after slicing it... Pretty lame, but it was the best I could come up with, and couldn't stop myself from posting it... Would've looked more sliced as you depict it; maybe: $ perl -e '@b=split //,"bread"; print "@b[0..4]\n"' b r e a d (The construct @array[...] in Perl is called an array slice.) -- Ken Irving, [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]