in reply to Why do I get a "used only once" warning here?

%MyApp::once if 0; # Suppress warning

Replies are listed 'Best First'.
Re^2: Why do I get a "used only once" warning here?
by Krambambuli (Curate) on Mar 16, 2009 at 08:08 UTC
    Isn't there an error in this ?!

    It neighter seems to suppress the warning, nor do I understand how this is supposed to work. :(

    Thanks,

    Krambambuli
    ---

      Why didn't you show what you tried instead of just saying what amounts to "Does not!"

      >perl -wle"$MyApp::once{x} ||= 1;" Name "MyApp::once" used only once: possible typo at -e line 1. >perl -wle"%MyApp::once if 0; $MyApp::once{x} ||= 1;" >