Ryszard has asked for the wisdom of the Perl Monks concerning the following question:

I've written a module, and when invoking it from a script I'm getting the old Unquoted string "dbhandler" may clash with future reserved word.. thing. The line of the error is where I call the new method.

I was wondering if its an old version thing or I'm doing something so damn obvious I cant see the wood for the trees. Snippet below:

#!/usr/bin/perl -wT BEGIN {push @INC, "../lib"}; use strict; use dbhandler; use Data::Dumper; my $dbstuff=dbhandler->new(handle=>'handle1', user=>'usename', pwd=>'p +assword',sid=>'database1'); $dbstuff->fetch_handle(handle=>'handle2', user=>'usename',pwd=>'passwo +rd',sid=>'database2');

Replies are listed 'Best First'.
Re: Perl 5.005_03ism?
by busunsl (Vicar) on Mar 01, 2002 at 11:03 UTC
    Modulenames should be capitalized, otherwise Perl tries to treat them as pragmata and if such a pragma doesn't exist, sees the modulename as a bareword.

    From perldoc perlmod:

    Module names are also capitalized unless they're functioning as pragmas;
    pragmas are in effect compiler directives, and are sometimes called
    "pragmatic modules" (or even "pragmata" if you're a classicist).
    
Re: Perl 5.005_03ism?
by mattr (Curate) on Mar 01, 2002 at 10:29 UTC
    My guess is that with strict and a module starting with a lowercase letter you get that.. might also go away if you tried dbhandler::xxx->new. Perhaps the strict is checking a module you made (dbhandler) which itself was not written using strict? (i.e. error is within dbhandler?)
Re: Perl 5.005_03ism?
by mattr (Curate) on Mar 01, 2002 at 10:28 UTC
    My guess is that with strict and a module starting with a lowercase letter you get that.. might also go away if you tried dbhandler::xxx->new.