Re: no matching '}'
by Old_Gray_Bear (Bishop) on Feb 03, 2015 at 22:18 UTC
|
My usual assault on the missing '}' problem:
- Run the original code through pertidy and save the result.
- Edit the code to add a "}' as the last line of the new code.
- perltidy again and save the result.
- Run diff between the two outputs.
- Resolve/explain the diffs
It takes time,sorry but there is no Magic to sort it out.
For what it's worth, the last time I had to dig out of a missing brace, it was because someone had decided to use '}' as the delimiter in a compound Regex in some code originating for the 5.0.x era (Thank you Red Hat). I was contracted to bring up to the 'current version of Perl' -- 5.8.0. Sigh. Thanks again Red Hat. At least it keeps me in quick contracts.
----
I Go Back to Sleep, Now.
OGB
| [reply] [d/l] [select] |
Re: no matching '}'
by Eily (Monsignor) on Feb 03, 2015 at 17:15 UTC
|
Have you tried to Deparse it? I see three way to have brackets that don't match: source filters, quote constructs that are not parsed properly (only perl can parse perl) or the use of the -p or -n switch with an obfuscation like the eskimo kiss.
| [reply] |
|
deparse reports syntax OK
| [reply] |
|
| [reply] |
|
Re: no matching '}'
by LanX (Saint) on Feb 03, 2015 at 17:05 UTC
|
> any ideas
Eval? Regex? Import?
And you are hanging around here for a wile now, you should know that we'd like to see the error msg instead wasting time speculating.
| [reply] |
|
there are no error messages and no use of eval nor import.
I am using regex's.
I only found this by commenting on closing loops '}'. There is nothing indicating any error.
I am loath to attach the code.
| [reply] |
|
I have trouble understanding what you are doing.
Maybe try perltidy ...
| [reply] |
Re: no matching '}'
by Anonymous Monk on Feb 03, 2015 at 23:01 UTC
|
Vim-perl group suggests using matchit plugin. I can't post a link to github so search for 'vim-perl issue 86'. | [reply] |
|
'deparse' fixes the problem but it removes all comments!! and deconstructs hash declarations and generally crams everything together.....but the '{' matching works OK and the program runs OK.
| [reply] |
Re: no matching '}'
by sundialsvc4 (Abbot) on Feb 03, 2015 at 17:33 UTC
|
| [reply] |
|
yes....perlcritic, perltidy and 'perl -c' report that all is fine.
using strict and warnings
| [reply] |
|
I'm just realizing that you are talking about a vi problem with your way of coding...
Ahhhhhhhh!
| [reply] |
|
|
|