Well, "use warnings" and "-w" _are_ pretty much similar, but I didn't know that you'd turned on "-w" either as you didn't include that line in your previous code example :)

Generally, "use warnings" is prefered to "-w" as it's newer and more flexible.

I think you're looking in the wrong place for your warning messages. You have turned on "fatalsToBrowser" which means that _fatal_ errors are written to the browser. But the messages I am talking about are non-fatal warnings. This are not getting written to your browser, but they will be written to your web server error log. You need to look there for them.

Or, alternatively, looking at the docs for CGI::Carp I see that you can arrange for warnings to be sent as HTML comments to your browser by using code like:

(note that you probably want to ensure that you print the Content-type header as soon as possible with this usage)

But anyway, the warning was there (even if you couldn't find it!) And I told you what the warning was in my last message - "readline() on unopened filehandle". I even pointed out which line was causing the error.

So let's look at the code in a bit more detail.

You open the EXISTING filehandle, read in the file and then close the filehandle. You then do the same with the NEW filehandle (but you don't close it). The EXISTING filehandle is closed and the NEW filehandle is open. But (crucially) you have already read all of the data from NEW. The file pointer on that filehandle is at the END of the file. Any further attempt to read data from that filehandle will fail (and return undef).

So far so good.

You then use the <...> operator to read lines of data one at a time from the NEW filehandle. but remember what I said above. The file pointer is at the end of the file. You can't read data from it any more (you should probably be looking at the @new array rather than the NEW filehandle).

But Perl assumes that you are clever than it is. It assumes that you know what you are doing. It simply returns "undef" from the operation - to indicate that there's no data to be read from that filehandle.

So your "while" loop condition returns "undef" - which is "false". So the while loop never executes. No data ever gets into @diffs. So your page displays nothing.

Thanks for all your help, I think I'm almost there. I have the following code now (excuse the fact that I've removed the use strict and the use warnings I appreciate the importance of these now and shall be adding them in shortly:

In effect the answers that I want are there but I think that the problem is how I'm looping, I think that what I need to do is exit out of the 'if loop' when the asset is found (be it a 'matched' or a 'not matched') and then run the while loop again.

I'm still a bit unclear exactly what you are trying to do but I will assume you want to compare the list @new against @existing and see if the elements of @new do or do not already exist. If So you can try something like this:

I will have to leave it up to you to determine if using two separate arrays is best in this situation. I'm sure it can be done no problem. Notice how I switched the @new array to be the list you wanted to compare against the file/list , EXISTING or @existing in this case. You were going about it a bit backwards in my estimation.

Give it a try (pushing into two arrays) and if you really get stuck holler for help and someone (eventually) will reply. Make sure you understand all that Dave posted for you, he is the real Guru here, and his advice is worth its weight in gold. -------------------------------------------------