Help for this page

Select Code to Download


  1. or download this
    while (<TEST>) {
      my ($key,@fileData) = split /\|/;
    ...
      my ($key,@fileData) = split /\|/;
      $test{$key} = \@fileData;
    }
    
  2. or download this
    foreach my $key (keys %test) {
          push (@sorted, "$key|$test{$key}->[0]|$test{$key}->[1]|$test{$ke
    +y}->[2]|$test{$key}->[3]");
    ...
    foreach my $key (keys %test) {
          push @sorted, (join '|', ($key,@{$test{$key}});        
    }
    
  3. or download this
    open(TEST, ">test.txt") || die "File couldn't be opened for writing: $
    +!";
    foreach my $key (sort keys %test) {
    ...
      print TEST "\n";
    } 
    close(TEST);
    
  4. or download this
    foreach my $key (sort keys %test) {
    #to
    foreach my $key (sort { $test{$a}[-1] <=> $test{$b}[-1] } keys %test) 
    +{