Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Nov 2021 07:44:36 +0800
From:      Erich Dollansky <freebsd.ed.lists@sumeritec.com>
To:        Odhiambo Washington <odhiambo@gmail.com>
Cc:        questions <questions@freebsd.org>
Subject:   Re: Looking for a 3rd eye - perl errors
Message-ID:  <20211115234436.451ee5a4.freebsd.ed.lists@sumeritec.com>
In-Reply-To: <CAAdA2WMmszp8QiRZ8xayd3py0Gq8M_0BNq-k=XXwiN=rohhq6w@mail.gmail.com>
References:  <CAAdA2WMmszp8QiRZ8xayd3py0Gq8M_0BNq-k=XXwiN=rohhq6w@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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;
> }
> 
> 
> 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20211115234436.451ee5a4.freebsd.ed.lists>