http://qs321.pair.com?node_id=1079633


in reply to compare 2 arrays for intersect diff and commmon values

G'day rasgolla,

Welcome to the monastery.

"I am getting output as ..."

Please show actual output between <code>...</code> tags. That way we can see exactly what you're seeing.

Please also show expected output (again, between <code>...</code> tags). Then we can see the difference between what you got and what you were trying to get.

From what you've posted, if

DEBUG( "DEBUG: - difference links values $difference[0] " );

is producing

DEBUG: - difference links values ARRAY(0x34276a0)

but you actually wanted something like

DEBUG: - difference links values val1 val2 ... valN

then you'll need to dereference the $difference[0] arrayref:

DEBUG( "DEBUG: - difference links values @{$difference[0]} " );

That possibly raises a few questions, most of which may be answered by "Perl references short introduction".

If you have further questions, please follow the guidelines in "How do I post a question effectively?". Also, using a logical indentation, will make your code more readable for both you and us: that equates to less errors by you and, for us, a greater inclination to actually read your code.

-- Ken