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

Re: [perl #23630] problem with "used only once" warning

From:
John Peacock
Date:
August 28, 2003 17:36
Subject:
Re: [perl #23630] problem with "used only once" warning
Message ID:
3F4E9FBF.7020607@rowman.com
Fergal Daly wrote:
> 
>         Name "%s::%s" used only once: possible typo
>            (W once) Typographical errors often show up as unique variable
>            names.  If you had a good reason for having a unique name, then
>            just mention it again somehow to suppress the message.  The "our"
>            declaration is provided for this purpose.

+            NOTE: $c and @c are the same variable name for this purpose; if
+            two or more variables with the same name and different prefixes
+            are used only once, it will not trigger this warning.

> 
> speaks about variable names rather than variables but I wonder how many people 
> get that the subtle distinction without finding out the hard way,

How about something like that?  I suppose we could also suggest taking a look at 
an entry describing globs (but that seems like too detailed for a warning).

Personally, I don't think the likelyhood of someone getting bit by this 
particular "thinko" warrants confusing the docs.

John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4720 Boston Way
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5747




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