Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Learned monks, I have a subroutines file separate from my main program. It is pulled into "main.pl" with a "require subs.pl". When trying to run the program, I am told that there is a missing right curly or square bracket in the subs.pl at EOF. Obviously I have looked for this error, and in my wisdom I decided to comment out different subroutines to nail down which one was the offender. This provided no illumination, so I thought I'd comment out the whole file with POD directives so that all that remained was the "1;", at the end of the file. running the syntax checker on this then threw up the same error. How can this be, since there is now no useable code in the subroutines file.

Replies are listed 'Best First'.
Re: Missing bracket?
by gothic_mallard (Pilgrim) on Jan 10, 2005 at 14:55 UTC

    The problem may well be in the C<main.pl> file - without posting the code it's a bit tricky for someone here to nail down where the problem lies.

    --- Jay

    All code is untested unless otherwise stated.
    All opinions expressed are my own and are intended as guidance, not gospel; please treat what I say as such and as Abigail said Think for yourself.
    If in doubt ask.

    s++blah+;y(bl) .j.s;s+(h)+p$1+;???print:??;

Re: Missing bracket?
by punkish (Priest) on Jan 10, 2005 at 16:53 UTC
    1. Post the code
    2. Comment out require subs.pl in main.pl and see if you still get the error
    3. Post the code -- oh, I said that already.
    ;-)
      Thing is I am syntax checking the subs file only; here is an example of what I mean.
      =head sub FirstSub{ #code } ##################### sub Secondsub{ #code } ##################### sub Thirdsub{ #code } #################### =cut 1;
      Since I am ONLY checking the subs file, how can the main.pl file be causing the error.

        If you claim that there is no executable code in your required file (and you can make absolutely sure of this by requiring instead a file consisting only of:

        1;
        .) then it stands to reason that the problem must lie elsewhere.

        /J\

        I don't get any errors with the above code. Once again, post your entire code since it is hard to guess what have in your scripts.

        I fixed it. I just changed the 37th brace to a bracket in mail.pl


        Examine what is said, not who speaks.
        Silence betokens consent.
        Love the truth but pardon error.