my $pchr = "KQRBNP"; my $w1 = "QRKPNBNBQRK"; my %s; $s{$_}++ for split //, $w1; my $w2 = $pchr =~ s/(.)/$1 x $s{$1}/egr; print "$w1 -> $w2\n"
In reply to Re: Sort list by position of items in another list
by salva
in thread Sort list by position of items in another list
by gflohr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |