Help for this page

Select Code to Download


  1. or download this
    @array1 = ('one','two','three');
    @array2 = ("four","five","six");
    ...
    #OUTPUT
    one two three
    four five six
    
  2. or download this
    @array = qw(one two three);
    print @array, "\n";
    ...
    one two three          #spaced and the "\n" replaced with a new line.
    @array\n               #prints @array and "\n" as literals.
    
  3. or download this
    use strict;    #a good habit to start your program with line
    use warnings;  #another good habit too...
    ...
    print "@array4\n";
    print "@array5\n";
    
  4. or download this
    @array = qw(one two three four);
    for($index=0;$index<=$#array;$index++){
         print $array[$index],"\n";
         }