develooper Front page | perl.perl5.porters | Postings from October 2003

Re: [PATCH lib/warnings.t] Adding TODO functionality to lib/warnings.

From:
Abigail
Date:
October 1, 2003 05:54
Subject:
Re: [PATCH lib/warnings.t] Adding TODO functionality to lib/warnings.
Message ID:
20031001125423.GA29503@abigail.nl
On Wed, Oct 01, 2003 at 02:47:14PM +0200, H.Merijn Brand wrote:
> On Wed 01 Oct 2003 14:19, Abigail <abigail@abigail.nl> wrote:
> > *** lib/warnings.t.orig	Wed Oct  1 12:46:20 2003
> > --- lib/warnings.t	Wed Oct  1 13:51:01 2003
> > ***************
> > *** 76,81 ****
> > --- 76,83 ----
> >           $switch =~ s/(-\S*[A-Z]\S*)/"$1"/ if $Is_VMS; # protect uc switches
> >       }
> >       my($prog,$expected) = split(/\nEXPECT\n/, $_);
> > +     my ($todo, $todo_reason);
> 
>         my ($todo_reason, $todo) = ("");
> 
> To prevent unused warnings at the end when no reason is found

"unused"? That's only given for package variables that are used
once. I presume you mean "uninitialed" warnings, but see below.

> 
> > +     $todo = $prog =~ s/^#\s*TODO(.*)\n//m and $todo_reason = $1;


How so? If there's no reason, /(.*)/ will match the empty string,
and that's defined.

Do you have an example where it does generate a warning?


Abigail



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About