-
-
Save tokubass/3903728 to your computer and use it in GitHub Desktop.
同じ組み合わせのサイズは追加しないスクリプト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use Data::Dumper; | |
my @banner_size = ({ | |
width => 320, | |
height => 50, | |
}); | |
my $is_existing_size; | |
for my $size (@banner_size) { | |
my $key = join('-', $size->{widht}, $size->{heigth} ); | |
$is_existing_size->{$key} = 1; | |
} | |
my @add_size = ({ | |
width => 300, | |
height => 250, | |
},{ | |
width => 300, | |
height => 100, | |
},{ | |
width => 320, | |
height => 50, | |
}); | |
for my $size ( @add_size ) { | |
my $key = join('-', $size->{widht}, $size->{heigth} ); | |
unless ( $is_existing_size->{$key} ) { | |
push @banner_size, $size | |
$is_existing_size->{$key} = 1; | |
} | |
} | |
warn Dumper \@existing_banner_size; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment