in reply to comparing arrays

Your output looks ok.. can you clarify what "bunch of numbers" means? I think it might have been working for you, but it A) might not have been in the order you expected and B) run together, which you can easily fix with a newline:
foreach $value (@differences) { print $value . "\n"; }