Nicolas:

On Fri, Feb 20, 2015 at 10:29 AM, nicolas <nicolas...@mail.com> wrote:
> package vowCons2;
> use strict;
> use lib::avt;
> my $self = {};
> sub new {
>   my $this = shift;
>   my ($WORD) = @_;
> my $voyConsDef = readConfFile($CONFIG_FILE/vowConsDef);
> $self->{'V'} = $$voyConsDef{'V'};
>  $self->{'C'} = $$voyConsDef{'C'};
>
> I change
> my $voyConsDef = readConfFile("$CONFIG_FILE/vowConsDef");
> to : my $voyConsDef = readConfFile($CONFIG_FILE/vowConsDef);

The double quotes are necessary there because you're interpolating the
values of that variable into the string. Either that or you could
explicitly concatenate them like so:

my $voyConsDef = $CONFIG_FILE . "/vowConsDef";

The original form is probably preferred most of the time.

> I get this message
>
>
> Global symbol "$CONFIG_FILE" requires explicit package name at vowCons2.pm
> line 18.
> Compilation failed in require at sufpref.pm line 10.
> BEGIN failed--compilation aborted at sufpref.pm line 10.
> Compilation failed in require at ./base.pl line 32.
> BEGIN failed--compilation aborted at ./base.pl line 32.
>
> Should I create CONFIG_FILE directory ?

If I recall correctly you said that you are not an experienced
programmer, and I got the impression that this code was not
written by you. If you are the author, or maintainer, then by all
means follow the others' advice to try to fix it.

If you didn't write it, and don't understand it, and just want it
to work then I would try to ask the author/programmer to look at
it. This looks like a clear programming error so there's little a
user can do to make the code work. We don't even know it will
work, or how it's supposed to work. Perhaps the $CONFIG_FILE
variable was supposed to be exported from lib::avt? We don't
know. Declaring it explicitly in vowCons2.pm file might be the
very wrong thing to do...

Let us know your role in this and that will help us to give you
better advice... If there's a programmer that you work with that
is responsible for this then bring him coffee or beer and he'll
gladly fix you up.

Or worst case, if the guy responsible is long gone perhaps you
could attach a zip file or tarball of all of the code that you
have and a kind, bored soul can attempt to make sense of it...
Or somebody might offer their services in private for a fair
rate if needed (I'm not sure how much of that is tolerated on
the list).

Regards,


-- 
Brandon McCaig <bamcc...@gmail.com> <bamcc...@castopulence.org>
Castopulence Software <https://www.castopulence.org/>
Blog <http://www.bambams.ca/>
perl -E '$_=q{V zrna gur orfg jvgu jung V fnl. }.
q{Vg qbrfa'\''g nyjnlf fbhaq gung jnl.};
tr/A-Ma-mN-Zn-z/N-Zn-zA-Ma-m/;say'

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to