develooper Front page | perl.perl5.porters | Postings from May 2008

Re: Should potentially confusing labels emit a warning?

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
May 15, 2008 02:06
Subject:
Re: Should potentially confusing labels emit a warning?
Message ID:
20080515090644.GJ6780@plum.flirble.org
On Thu, May 15, 2008 at 10:59:03AM +0200, Dominic Dunlop wrote:
> 
> On 2008?05?15, at 10:27, Ed Avis wrote:
> 
> >I think that a warning is a good idea - I can't imagine any false  
> >positives, and
> >you already have evidence that people tend to make this mistake.
> 
> Trouble is, some of it's CGI, and people whinge loudly when previously- 
> clean CGI starts warning:
> 
> <http://google.com/codesearch?as_q=%22BEGIN%3A+%22&btnG=Search+Code&hl=en&as_lang=perl&as_license_restrict=i&as_license=&as_package=&as_filename=%5C.cgi%24&as_case=y 
> >
> 
> (Webloc attached, as the above is bound to be mangled, especially by  
> Mac OS X Mail.)

Well, something ate the attachment in transit, but from the 5 results I see
there, two are comments. One is

# remove all clients from "Add clients" list that already belong to search tag
BEGIN: foreach $line(@AllClients) {
chomp $line;

        foreach $match(@RemoveClients) {
        if ($line eq $match) {

        next BEGIN;
        }
        }

push @newAllClients,$line;
}

http://google.com/codesearch?hl=en&q=+lang:perl+file:\.cgi%24+%22BEGIN:+%22+show:D5kkTIBfuD0:v2tPawxb-Kg:JnJeEnCFNNw&sa=N&cd=3&ct=rc&cs_p=http://downloads.sourceforge.net/obrt/obrt_rel-0-2.tar.gz&cs_f=OBRT/search_tags.cgi

and the other two are (near) duplicates:

use vars qw( $JSMenuBar $JSIndexPage $JSMesgPage );
BEGIN: {
    jscript_define();
    $ENV{'M2H_USELOCALTIME'} = 1;
}

http://google.com/codesearch?hl=en&q=+lang:perl+file:\.cgi%24+%22BEGIN:+%22+show:h8_hyw4Za6M:uj7DwsUBsgQ:ut4d8_RlS7s&sa=N&cd=1&ct=rc&cs_p=http://www.mhonarc.org/release/MHonArc/tar/MHonArc-2.6.16.zip&cs_f=MHonArc-2.6.16/admin/mhaadmin.cgi

The former wouldn't warn if we could arrange that only /BEGIN:\s*{/ warned.
The latter looks like a bug. (But I suspect that it's actually not, just a
code style I've not met, as there's a MAIN: { ... } later on.

Nicholas Clark

Thread Previous | Thread Next


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