If perl was math we could say:
@colors - @drop = @colorsBut perl is perl so we have to say:
@colors = -@drop + @colorsPerl can do that, like this:
@colors = (miniature @drop program here) @colorsThe flow of information goes:
__<________________________<__
#4/ \#3
@colors = (miniature > program > here) @colors
#2\__<___________________<___/#1
The mini program goes inside map {} like:
@colors = map { my $x = join '|', @drop; /$x/ ? () : $_ } @colors;
Unrolled:
@colors =
map {
my $x = join '|', @drop; # make a regex
/$x/ ? () : $_ # simpler than it looks
}
@colors;
In reply to Re: The error says the value is uninitialized, but it works anyway
by Anonymous Monk
in thread The error says the value is uninitialized, but it works anyway
by mizducky
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |