SPUG: Annoying "name only used once" msg from -w

Richard Anderson starfire at zipcon.net
Thu Apr 27 11:17:51 CDT 2000


I often set a variable in the main program that is only referenced in a
subroutine that is in another file.  I don't want to explicitly pass it to
the subroutine because I am dealing with large numbers of parameters, so I
refer to it in the subroutine as $main::foo.

When I use the perl -w command line option, I get annoying messages like
Name "main::date" used only once: possible typo ...

Is there any other way to shut this message off other than:
(1) Adding a gratuitous reference to the variable
(2) Explicitly passing the variable to the subroutine
(3) Turning off the -w option
(4) Copying the subroutine code into the file containing the main program

Richard.Anderson at seaslug.org
www.zipcon.net/~starfire/home (personal)
www.raycosoft.com (corporate)


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
 Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
 SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe
           Email to majordomo at pm.org: "action" spug-list your_address





More information about the spug-list mailing list