in reply to Re: Removing doubles and printing only unique values
in thread Removing doubles and printing only unique values

Hi,

Thank you sooo much! This does exactly what I need it to do.

At first I did not understand at all how it would 'know' which field it needs to extract, but I guess it is because my $vk is the second field in (undef, my $vk)? So if I would need the third field, this part of the code would be (undef, undef, my $vk)? Is that right?

Replies are listed 'Best First'.
Re^3: Removing doubles and printing only unique values
by Eily (Monsignor) on Oct 31, 2017 at 13:41 UTC

    Yes! And you can of course fetch several values with: my (undef, $second, $third) = split .... my (undef, $var, $other) is the same as (undef, my $var, my $other)

    Note that haukex is right about Text::CSV though, as long as your input stays simple (ie: no field contains the ; character, or a newline) split will do the work, but if there's any chance that your data can be more complex, it's just either to use the module rather than try to handle all the special cases by hand.