[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Omaha.pm] All possible DNA sequences that are 5-7 bases long



Perl, a journey of learning that lasts a lifetime...   :)

j



Quiz: Are these two the same thing?
   (0) x 7
    0  x 7
If not, how are they different?


$ perl -d -e 1

  DB<4> @j = (0) x 7

  DB<5> x @j
0  0
1  0
2  0
3  0
4  0
5  0
6  0

  DB<6> @j = 0 x 7

  DB<7> x @j
0  0000000


Answer: Nope. The first gives you an array of 7 elements, and each one is a zero. The second gives you an array of a single scalar which is seven zeros.