Help for this page

Select Code to Download


  1. or download this
    my %order_line = read_from_csv();
    my @fields = qw(firstname lastname);
    my %identity;
    @identity{@fields} = @order_line{@fields};
    my $customer = Customer->find_or_create(\%identity);
    
  2. or download this
    my %order_line = read_from_csv();
    my @fields = qw(firstname lastname);
    my $customer =
      Customer->find_or_create({ map {$_ => $order_line{$_}} @fields });
    
  3. or download this
    #!/usr/bin/perl
    
    ...
    #                Rate   with_map with_slice
    # with_map   110277/s         --       -28%
    # with_slice 153325/s        39%         --