bracket checker - http://pastebin.com/d8GNL0kx - Any clue on the error?
am 29.07.2011 00:25:54 von newbie01 perl--20cf30427190f53d9704a928a5ba
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Hi,
Am just trying out this bracket checker script but when I ran it, it is
giving errors below.
Just curious to know what the error is about? Please advise. Thanks
Error below:
http://pastebin.com/d8GNL0kx
../123.pl testfile01x.ora
Malformed UTF-8 character (unexpected continuation byte 0xbb) at ./123.plli=
ne 8.
Malformed UTF-8 character (unexpected continuation byte 0xbb) at ./123.plli=
ne 8.
Malformed UTF-8 character (unexpected continuation byte 0xbb) at ./123.plli=
ne 8.
Malformed UTF-8 character (unexpected continuation byte 0xbb) at ./123.plli=
ne 8.
Malformed UTF-8 character (unexpected continuation byte 0xbb) at ./123.plli=
ne 8.
Malformed UTF-8 character (unexpected continuation byte 0xbb) at ./123.plli=
ne 8.
Malformed UTF-8 character (unexpected continuation byte 0xbb) at ./123.plli=
ne 8.
Malformed UTF-8 character (unexpected continuation byte 0xbb) at ./123.plli=
ne 8.
Malformed UTF-8 character (unexpected continuation byte 0xbb) at ./123.plli=
ne 8.
Malformed UTF-8 character (unexpected continuation byte 0xbb) at ./123.plli=
ne 8.
Malformed UTF-8 character (unexpected continuation byte 0xab) at ./123.plli=
ne 8.
Malformed UTF-8 character (unexpected continuation byte 0xbb) at ./123.plli=
ne 8.
Malformed UTF-8 character (unexpected continuation byte 0xbb) at ./123.plli=
ne 8.
Malformed UTF-8 character (unexpected continuation byte 0xbb) at ./123.plli=
ne 8.
Malformed UTF-8 character (unexpected continuation byte 0xbb) at ./123.plli=
ne 8.
Malformed UTF-8 character (unexpected continuation byte 0xbb) at ./123.plli=
ne 8.
Malformed UTF-8 character (unexpected continuation byte 0xab) at ./123.plli=
ne 8.
Malformed UTF-8 character (unexpected continuation byte 0xbb) at ./123.plli=
ne 8.
Malformed UTF-8 character (unexpected continuation byte 0xbb) at ./123.plli=
ne 8.
Malformed UTF-8 character (unexpected continuation byte 0xbb) at ./123.plli=
ne 8.
Malformed UTF-8 character (unexpected continuation byte 0xbb) at ./123.plli=
ne 8.
Malformed UTF-8 character (unexpected continuation byte 0xbb) at ./123.plli=
ne 8.
Malformed UTF-8 character (unexpected continuation byte 0xbb) at ./123.plli=
ne 8.
Malformed UTF-8 character (unexpected continuation byte 0xbb) at ./123.plli=
ne 8.
Malformed UTF-8 character (unexpected continuation byte 0xab) at ./123.plli=
ne 8.
Malformed UTF-8 character (unexpected continuation byte 0xbb) at ./123.plli=
ne 8.
Malformed UTF-8 character (unexpected continuation byte 0xab) at ./123.plli=
ne 8.
Malformed UTF-8 character (unexpected continuation byte 0xbb) at ./123.plli=
ne 8.
Malformed UTF-8 character (unexpected continuation byte 0xab) at ./123.plli=
ne 8.
Malformed UTF-8 character (unexpected continuation byte 0xab) at ./123.plli=
ne 8.
Malformed UTF-8 character (unexpected continuation byte 0xbb) at ./123.plli=
ne 8.
Malformed UTF-8 character (unexpected continuation byte 0xbb) at ./123.plli=
ne 8.
Sequence (?|...) not recognized before HERE mark in regex m/(?| << HERE
(\()(?&matched)([\}\]..»?>»??]|$) |
(\{)(?&matched)([\)\]..»?>»??]|$) |
(\[)(?&matched)([\)\}..»?>»??]|$) |
(.)(?&matched)([\)\}\].»?>»??]|$) |
(.)(?&matched)([\)\}\].»?>»??]|$) |
(«)(?&matched)([\)\}\]..?>»??]|$) |
(?)(?&matched)([\)\}\]..»>»??]|$) |
(<)(?&matched)([\)\}\]..»?»??]|$) |
(«)(?&matched)([\)\}\]..»?>??]|$) |
(?)(?&matched)([\)\}\]..»?>»?]|$) |
(?)(?&matched)([\)\}\]..»?>»?]|$) | at ./123.pl line 34.
Code below or can be copied from http://pastebin.com/d8GNL0kx
#!/usr/bin/perl
use strict;
use utf8;
binmode STDOUT,":utf8";
use File::Find;
my $checkre =3D qr/(?|
(\()(?&matched)([\}\]ââºÂ»ãã=80 ã=80=
ãã=8F]|$) |
(\{)(?&matched)([\)\]ââºÂ»ãã=80 ã=80=
ãã=8F]|$) |
(\[)(?&matched)([\)\}ââºÂ»ãã=80 ã=80=
ãã=8F]|$) |
(â=9C)(?&matched)([\)\}\]âºÂ»ãã ã=80=
ãã=8F]|$) |
(â=B9)(?&matched)([\)\}\]â»ãã ã=80=
ãã=8F]|$) |
(«)(?&matched)([\)\}\]ââºãã=80 ã=80=
ãã=8F]|$) |
(ã=90)(?&matched)([\)\}\]ââºÂ»ã ã=80=
ãã=8F]|$) |
(ã=88)(?&matched)([\)\}\]ââºÂ»ã ã=80=
ãã=8F]|$) |
(ã=8A)(?&matched)([\)\}\]ââºÂ»ã ã=80=
ãã=8F]|$) |
(ã=8C)(?&matched)([\)\}\]ââºÂ»ã ã=80=
ãã=8F]|$) |
(ã=8E)(?&matched)([\)\}\]ââºÂ»ã ã=80=
ãã=8D]|$) |
(^)(?&matched)([\)\}\]ââºÂ»ãã=8 0ã=80=
ãã=8F]))
(?(DEFINE)(?
\((?&matched)\) |
\{(?&matched)\} |
\[(?&matched)\] |
â=9C(?&matched)â=9D |
â=B9(?&matched)â=BA |
«(?&matched)» |
ã=90(?&matched)ã=91 |
ã=88(?&matched)ã=89 |
ã=8A(?&matched)ã=8B |
ã=8C(?&matched)ã=8D |
ã=8E(?&matched)ã=8F |
[^\(\{\[ââ¹Â«ããã=8A= E3=E3=
\)\}\]ââºÂ»ããã ã=E3=
]++)*+))
/sx;
sub check_file {
if(-f && /\.txt$/) {
if(open(my $fh,'<:encoding(UTF-8)',$_)) {
undef $/;
my $data =3D <$fh>;
if($data =3D~ $checkre) {
if(!length $2) {
print "File $File::Find::name has unclosed bracket $1 a=
t
position $-[1]\n";
}
elsif(!length $1) {
print "File $File::Find::name has unopened bracket $2 a=
t
position $-[2]\n";
}
else {
print "File $File::Find::name has mismatched brackets $=
1
$2 at positions $-[1] and $-[2]\n";
}
}
} else {
print STDERR "Cannot open $File::Find::name: $!\n";
}
}
}
@ARGV =3D ('.') unless @ARGV;
find(\&check_file,@ARGV);
--20cf30427190f53d9704a928a5ba--