Help for this page

Select Code to Download


  1. or download this
    my $padded=sprintf("%08.3f",39.452);
    
  2. or download this
    while (<>){
      split /:/;
      $_[0]=sprintf("%08.3f", $_[0]);
      push @data, join ":", @_;
    }
    
  3. or download this
        sort{ $a <=> $b} @numbers;
    
  4. or download this
    sort{extract( $a ) <=> extract( $b )} @lines;
    
    ...
      split /:/, $a;
      $_[0];
    }
    
  5. or download this
    my %hash;
    while(<>){
    ...
      $hash{ $key } = $data;
    }
    print "Sorted!:\n\n", join "|", sort {$a <=> $b} keys %hash;
    
  6. or download this
    $key .= ':001' if defined $hash{$key};
    $key++ while defined $hash{$key};