missing curly - brain fried
- From: amichai@xxxxxxxxxx (Amichai Teumim)
- Date: Thu, 28 Jun 2007 17:54:01 +0300
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";
}
- Follow-Ups:
- Re: missing curly - brain fried
- From: Tom Phoenix
- Re: missing curly - brain fried
- From: jbuburuz
- Re: missing curly - brain fried
- From: Martin Barth
- Re: missing curly - brain fried
- Prev by Date: Re: parsing a line
- Next by Date: Re: String Manipulation
- Previous by thread: How can i make a perl program lauch another perl program that takes options
- Next by thread: Re: missing curly - brain fried
- Index(es):