Help for this page

Select Code to Download


  1. or download this
    # take the values in @array and use them as a hash slice to make all o
    +f the values 1
    @hash{@array} = (1) x @array;
    
  2. or download this
    # take the values in @array and use them as keys in %hash, incrementin
    +g the values associated with said keys by one
    for (@array) { $hash{$_}++; }
    
  3. or download this
    $hash{$_}++ for (@array); # same as above only with the for at the end
    
  4. or download this
    print+map{sprintf'&#%d;',$_}unpack'C*',$_;
    
  5. or download this
    print map { sprintf '&#%d;', $_ } unpack 'C*', $string;
    
  6. or download this
    print map {
      sprintf '&#%d;', $_
    } unpack 'C*', $string;
    
  7. or download this
    $VAR1 = {
              'YZ0' => undef,
    ...
              'PQR' => undef,
              'GHI' => undef
            };
    
  8. or download this
    $VAR1 = {
              'YZ0' => 1,
    ...
              'PQR' => 1,
              'GHI' => 1
            };
    
  9. or download this
    @hash{@array} = (1 x @array);