[plug] Perl: Intersection of two arrays?

Arie Hol arie99 at ozemail.com.au
Tue Jun 24 20:35:53 WST 2003


At 05:23 PM 24-06-2003 +0800, you wrote:
>Given two arrays (in Perl) with string values, I need to derive an array of 
>the elements in both. I'd like to do this quickly, too. ^_^

Have you tried :

@new_array = @array1 . @array2;

OR maybe :

foreach $string (@array2)
        {
        push(@array1, $string);
        }

Or maybe :

@array1 .= @array2;


HTH
Regards Arie

>--------------------------------------------<

For the concert of life, nobody has a program.

>--------------------------------------------<



More information about the plug mailing list