Is there a more elegant means of checking an array for the presence
of a variable before adding it? - grep so far does not work for me.

I currently use

                $count = 0;
                foreach $g (@gs) {
                        if ($g eq @parsed[2]) {
                        $count++;
                        last;
                        }
                }
                if ($count == 0) {
                        push @gs, @parsed[2];
                }

which seems unwieldy, and BASIC-like.


-- 
Ian Fitzgerald - Melbourne Australia - Acorn RiscPC SA233

Reply via email to