Help for this page

Select Code to Download


  1. or download this
    my $string = "bob 299 frank 107 ted 300";
    my %hash = split /\s+/, $string;
    ...
    foreach (keys %hash) {
        print "$_, $hash{$_}\n";
    }
    
  2. or download this
    my $file = "/home/andrew/data.txt";
    my @array;
    ...
    foreach (@array) {
        print "$_\n";
    };