Date: Mon, 15 Nov 2021 13:00:26 +0300 From: Odhiambo Washington <odhiambo@gmail.com> To: questions <questions@freebsd.org> Subject: Looking for a 3rd eye - perl errors Message-ID: <CAAdA2WMmszp8QiRZ8xayd3py0Gq8M_0BNq-k=XXwiN=rohhq6w@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
--0000000000001f46ed05d0d0e324 Content-Type: text/plain; charset="UTF-8" Hi everyone, Looking for a 3rd eye here: In the code below, I am getting these errors: 1. sub mp3_filter($$$$) { my ($contref, $weighted_str, $fields, $headings) = @_; mp3::get_title($$contref, $weighted_str, $fields); mp3::get_author($$contref, $fields); mp3::get_album($$contref, $fields); $$contref =~ s/^\w+:{1,1}?//gm; <= Error: Useless use of greediness modifier '?' in regex; marked by <-- HERE in m/^\w+:{1,1}? <-- HERE 2. sub get_uri ($$) { my ($cfile, $fields) = @_; my ($uri); my (%param); if ($cfile =~ /^(.*)\/d(\d\d\d\d*)([0-1]\d)([0-3])(\d)\.hnf$/) { $param{'year'} = $2; $param{'month'} = $3; $param{'day'} = $4 . $5; $param{'hiday'} = $4; if ($param{'day'} < 11) { $param{'abc'} = "a"; } elsif ($param{'day'} < 21) { $param{'abc'} = "b"; } else { $param{'abc'} = "c"; } if ($hnf::link_templ) { $uri = $hnf::link_templ; } elsif ($hnf::hns_version >= 2) { $uri = '?%year%month%abc#%year%month%day0'; # for hns-2.00 or later } else { $uri = '?%year%month%hiday#%year%month%day0'; # for hns-1.x } $uri =~ s/%%/\34/g; $uri =~ s/%{?([a-z]+)}?/$param{$1}/g; <======Error: Unescaped left brace in regex is passed through in regex; marked by <-- HERE in m/%{ <-- HERE ?([a-z]+)}?/ $uri =~ s/\34/%/g; $uri = $hnf::diary_uri . $uri; $uri =~ s/%7E/~/i; } $fields->{'uri'} = $uri; $fields->{'author'} = $hnf::author; } -- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", egrep -v '^$|^.*#' :-) --0000000000001f46ed05d0d0e324--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAAdA2WMmszp8QiRZ8xayd3py0Gq8M_0BNq-k=XXwiN=rohhq6w>