in reply to Compare two files (Ip addresses)

Your data representation in File2 does not match the filespec you describe verbally (ie. Company 2 spans across subnets, and hence it is unclear how/why it would match the entries from File1 if only the last octet is to be compared).

Do you have any control over how data will be represented in the files? If you do, you might benefit from redesigning the data file layouts.

Also, please reformat your question with code tags, as in:

<code> ... your tidy Perl code goes here ... </code>

Where do you want *them* to go today?