in reply to How do I find the missing curly brace??
I tried this with a 30k lines module and the output had 5k lines.
you'll get something like this which is easier to be checked visually:
... ## end sub check_rLL sub check_keys { grep { !exists $rvalid->{$_} } keys %{$rtest}; grep { !exists $rtest->{$_} } keys %{$rvalid}; if ($exact_match) { $error ||= @missing_keys } if ($error) { my @expected_keys = sort keys %{$rvalid}; } } ## end sub check_keys sub check_token_array { foreach my $KK ( 0 .. @{$rLL} - 1 ) { my $nvars = @{ $rLL->[$KK] }; if ( $nvars != _NVARS ) { } foreach my $var ( _TOKEN_, _TYPE_ ) { if ( !defined( $rLL->[$KK]->[$var] ) ) { } } } } ## end sub check_token_array { ## begin closure check_line_hashes BEGIN { @valid_line_hash{@valid_line_keys} = (1) x scalar(@valid_line_ +keys); ...
One extra hint: since nesting subs is rare in Perl I'd also grep for sub keywords which are (unusually) intended.
That's only 600 lines in this case.
Apply perltidy -csci=0 -csc for "closing side comments" everywhere to identify the closing } of sub, if, etc.
Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How do I find the missing curly brace??
by perlfan (Parson) on Dec 31, 2024 at 08:53 UTC | |
by LanX (Saint) on Dec 31, 2024 at 11:41 UTC | |
by pfaut (Priest) on May 07, 2025 at 19:07 UTC | |
|
Re^2: How do I find the missing curly brace??
by harangzsolt33 (Deacon) on Dec 31, 2024 at 00:36 UTC |