in reply to Help on variable declaration with "use strict "

damn.. that is right! Since I am a newbie I have little confidence in my understanding of the concepts. So it made me suspect the declaration instead of checking the syntax. Apologies.

  • Comment on Re: Help on variable declaration with "use strict "

Replies are listed 'Best First'.
Re^2: Help on variable declaration with "use strict "
by ikegami (Patriarch) on Jun 01, 2011 at 16:52 UTC
    It was hard to spot. The reason it's a strict error is that
    use Data::Dumper my %count;

    is the same as

    BEGIN { require Data::Dumper; import Data::Dumper my %count; }

    The curlies of the implicit BEGIN limited the scope of the lexical.