in reply to How do I find the missing curly brace??
Use perl to find perl errors.
#!/usr/bin/perl use strict; # https://perlmonks.org/?node_id=11163431 use warnings; my @what_lines; @ARGV = '3raindeermaze.pl'; # FIXME while( <> ) { for ( split // ) { /\{/ ? push @what_lines, $. : /\}/ ? pop @what_lines : 0; } } print "line numbers with unmatched { => @what_lines\n";
Comment out the ARGV line to use your file as the argument to the program.
( I just did that for testing. )
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: How do I find the missing curly brace??
by LanX (Saint) on Dec 30, 2024 at 18:22 UTC |