Hi Amichai, first of all never write own code without these two lines:
use strict; use warnings; this should allways help a lot. Remember the e-mail from Chas Owens regarding the "shuffling cards". making comments in perl goes this way: # hello, i am a comment. you made C-style comments: //, /* and */ are not allowed in perl. there are some other mistakes in your code (e.g use "for" always in this way: for(..) { .. } ) but you should fix your comments first and then you can start over trying to learn perl :) Have fun! HTH, Martin On Thu, 28 Jun 2007 17:54:01 +0300 "Amichai Teumim" <[EMAIL PROTECTED]> wrote: > Where is the open curly missing here? > > #!/usr/bin/perl > > @array = (5,3,2,1,4); > > > for ($i=0; $i<$n-1; $i++) { > ( for ($j=0; $j<$n-1-$i; $j++) > > > if ($array[$j+1] < $array[$j]) { /* compare the two neighbors > */ > $tmp = $array[$j]; /* swap $array[j] and $array[j+1] > */ > $array[$j] = $array[$j+1]; > $array[$j+1] = $tmp; > } > } > > > foreach $elem (@array){ > print "$elem"; > } -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/