fork download
  1. #!/share/bin/perl
  2. @Names = ("London", "Paris", "New York", "Mumbai", "Cairo", "Tokyo", "Sao Paulo", "Detroit");
  3.  
  4. # Several forms of for loop used to print the contents of the list
  5. $size = @Names;
  6. print "There are ", $size, " Cities:\n";
  7. for($i=0;$i<$size;$i++) {
  8. print $Names[$i] , "\n";
  9. }
  10.  
  11.  
Success #stdin #stdout 0.01s 5276KB
stdin
Standard input is empty
stdout
There are 8 Cities:
London
Paris
New York
Mumbai
Cairo
Tokyo
Sao Paulo
Detroit