in reply to Bareword "SCALAR" not allowed while "strict subs" in use at C:/Perl/site/lib/DateTime/Locale.pm line 41.

If you trace SCALAR back, you will note it at the top of the module in the line: use Params::Validate qw( validate validate_pos SCALAR ); This line imports SCALAR into your namespace. Do you have Params::Validate in your path? Have you or one of your colleagues hacked this file or the Params/Validate.pm file?
  • Comment on Re: Bareword "SCALAR" not allowed while "strict subs" in use at C:/Perl/site/lib/DateTime/Locale.pm line 41.
  • Select or Download Code

Replies are listed 'Best First'.
Re^2: Bareword "SCALAR" not allowed while "strict subs" in use at C:/Perl/site/lib/DateTime/Locale.pm line 41.
by nocool (Novice) on Aug 17, 2010 at 19:41 UTC
    All other module I downloaded from CPAN site are installed using following syntax.
    perl makefile.pl
    dmake
    dmake install

    but the Params-Validate-0.95 modile dont have makefile.pl but there is build.pl so I run this file. I have the Validate.pm file located at C:\Perl\site\lib\Params folder in my machine. Also you mention "Do you have Params::Validate in your path?".. does this mean I have to update environment variable with some value.. and with what value?


    Please help
      What happens when you run the following script?

      #!/usr/bin/perl use strict; use warnings; use Params::Validate qw( validate validate_pos SCALAR ); print SCALAR, "\n";

      And this one?

      #!/usr/bin/perl use strict; use warnings; use DateTime::Locale; print "1\n";
        When I run the first code I got following error message --
        I save this code with name test.pl

        Name "main::SCALAR" used only once: possible typo at test.pl line 6.
        print() on unopened filehandle SCALAR at test.pl line 6.

        And when I run another piece of code that time I got same error which is a subject line of this thread.