Re: Looking for a 3rd eye - perl errors
- In reply to: Odhiambo Washington : "Looking for a 3rd eye - perl errors"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 15 Nov 2021 23:44:36 UTC
Hi,
if you cannot get an answer here, you might have a try with more PERL
orientated lists like:
https://lists.freebsd.org/subscription/freebsd-perl
Erich
On Mon, 15 Nov
2021 13:00:26 +0300 Odhiambo Washington <odhiambo@gmail.com> wrote:
> 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;
> }
>
>
>