Help for this page

Select Code to Download


  1. or download this
    my @people= ();
    my @names = qw(jack peter smith jason patrick sylvia randa debbie dian
    +e 
    ...
       $hash{"name"} = $names[$i];
       push (@people, \%hash);
    }
    
  2. or download this
    # some sort algorithm goes here
    @sorted = sort by_name @people; 
    ...
       my %person = %{$sorted[$i]};
       print "$person{name} is $person{age} years old.\n";
    }