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

RE: Should potentially confusing labels emit a warning?

Thread Previous | Thread Next
From:
Ed Avis
Date:
May 15, 2008 09:48
Subject:
RE: Should potentially confusing labels emit a warning?
Message ID:
1EC0234F7B1CA34BA1E99F48A817A1BDC27EFC@wcl-exc.wcl.local
Dominic Dunlop <shouldbedomo@mac.com> wrote:

[writing BEGIN: {} instead of BEGIN {}]

>>I think that a warning is a good idea - I can't imagine any false 
>>positives,

>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>

Ha ha ha.  I think any possible programmer mistake can be found in a Perl CGI program somewhere.  The use in mhaadmin.cgi is an error, the programmer intended a BEGIN block (though presumably the script still works if the code is executed after compilation has finished).  The use in search_tags.cgi is a genuine loop label jumped to with 'next'.

IMHO, the existence of this code is an argument in _favour_ of adding the warning.  After all warnings do not stop code working but just give a message to the programmer.  People who complain about that are shooting the messenger.

-- 
Ed Avis <eda@waniasset.com> 

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

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