in reply to Removal of duplicated element in array.
One issue are the parantheses in split("(\n)",$match). They preserve the delimiters \n as part of your array and are also present in the final result @r. Try
split /\n/, $match
instead. You can also do it as a one-liner:
my @r = keys { map { $_ => 1 } split /\n/, $match };
UPDATE: I mean the parantheses in "(\n)", not the outer ones.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Removal of duplicated element in array.
by tty1x (Novice) on May 06, 2013 at 14:54 UTC | |
by hdb (Monsignor) on May 06, 2013 at 15:02 UTC | |
by tty1x (Novice) on May 07, 2013 at 02:19 UTC | |
|
Re^2: Removal of duplicated element in array.
by tty1x (Novice) on May 06, 2013 at 14:36 UTC |