in reply to Open file .h error

Update: So on a second read I think you're telling us that line five of your code is the open statement. The error message you're getting is because the open is failing. The failure could be for any one of a number of reasons: no permission to open the file, or the file doesn't exist where you're looking, among other possible reasons. If your die statement were replaced with or die $!, then your error message would give you more info as to what might be the problem. We certainly haven't been given enough information to provide a complete diagnosis.


The remainder of this post is my original mistaken reaction to the unclear question.

The error is in (or possibly right before) line five of nextline.pl. If line five of nextline.pl is this:

#ifndef __COBRA_H_EXTERNAL_GUARD__

... then the problem could be that #ifndef __COBRA_H_EXTERNAL_GUARD__ is not Perl, it's a preprocessing directive for the C or C++ preprocessor. You can't feed C directly to perl and expect it to know what to do with it.

On the other hand, if #ifndef __COBRA_H_EXTERNAL_GUARD__ is line five of your input file (which is probably the case), then you're barking up the wrong tree. We would need to see line five of your Perl script (and probably a few lines on either side of line five). Your program is failing on line five of the Perl script. Not on line five of the input file.

Before posting additional information be sure to read Writeup Formatting Tips so that you can make your post legible.


Dave