in reply to Array unification problem has me in circles

I'm not sure how you are looping through those arrays, but an easy way to make @data contain only unique items might go like so:
my %tmp = map { $_ => 1} @data; my @uniq_data = sort keys %tmp;
Then, just use that to loop through the other structures, outputing defined keys only once.

---
echo S 1 [ Y V U | perl -ane 'print reverse map { $_ = chr(ord($_)-1) } @F;'
Warning: Any code posted by tuxz0r is untested, unless otherwise stated, and is used at your own risk.

Replies are listed 'Best First'.
Re^2: Array unification problem has me in circles
by dragonchild (Archbishop) on Nov 07, 2007 at 18:09 UTC
    Or, written more cleanly:
    use List::MoreUtils qw( uniq ); my @uniq_data = uniq @data;

    My criteria for good software:
    1. Does it work?
    2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
Re^2: Array unification problem has me in circles
by parv (Parson) on Nov 08, 2007 at 21:50 UTC

    Could avoid setting the 1s since values are absolutely being ignored, but it's a two step process ...

    my %tmp; @tmp{ @data } = ();