Maybe the missing opening bracket on the third line?

>$a2[$p] = undef  if $a1[$j] == $a2[$p];

Being a beginner myself, I cannot recommend a better way.

- Jan

Jerry Preston wrote:

>Hi!,
>
>I know that this is a no brainer, but I cannot not get it!  I want to
>compare two arrays and delete the same values in one array.
>
>foreach $j ( @a1 ) {
>  foreach $p ( @a2 ) {
>    $a2[ $p ] = undef  if $a1[ $j ] == $a2 $p ];
>  }
>}
>
>What is wrong and is there a better, PERL way to do this?
-- 
There are 10 kinds of people:  those who understand binary, and those who don't

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to