Not 100% sure I'm not misunderstanding you, but...
[johnsca@CORY tmp]$ cat tst #!/usr/bin/perl use warnings; use strict; sub foo { return 3 } *import = \&foo; [johnsca@CORY tmp]$ perl -c tst Name "main::import" used only once: possible typo at tst line 8. tst syntax OK [johnsca@CORY tmp]$ cat tst2 #!/usr/bin/perl use warnings; use strict; sub foo { return 3 } { no warnings; *import = \&foo; } [johnsca@CORY tmp]$ perl -c tst2 tst2 syntax OK [johnsca@CORY tmp]$ cat tst3 #!/usr/bin/perl use warnings; use strict; sub foo { return 3 } *blah = \&foo; [johnsca@CORY tmp]$ perl -c tst3 Name "main::blah" used only once: possible typo at tst line 8. tst syntax OK
So, in summary, you can suppress the warnings with no warnings, and *import is not special, typeglobs are just exempt from use strict;.
Hope that answers your questions.
bbfu
Black flowers blossum
Fearless on my breath
In reply to (bbfu) Re: 'used once' during perl -c
by bbfu
in thread 'used once' during perl -c
by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |