fork download
  1. #!/usr/bin/perl
  2. # your code goes here
  3. print "enter array";
  4. @arr=<STDIN>;
  5. $count=0;
  6. print @arr;
  7. while($count < @arr)
  8. {
  9. $i=1;
  10. while([$i-1] > arr[$i])
  11.  
  12. {
  13. @arr[$i-1,$i]=@arr[$i,$i-1];
  14. $i++;
  15. }
  16. $count++;
  17. }
  18. print @arr;
  19.  
  20.  
  21.  
Runtime error #stdin #stdout #stderr 0s 6000KB
stdin
6
7
8
9
1
3
0
stdout
Standard output is empty
stderr
syntax error at prog.pl line 10, near "arr["
syntax error at prog.pl line 17, near "}"
Execution of prog.pl aborted due to compilation errors.