Youare trying to print the value of $v before its declaration

print "value of v is $v\n";

Try defining this variable before this print statement.



Shobha Deepthi V
The statement below is true.
The statement above is false.






Ken Killer wrote:

I tried to add 'my' before $v, but I got same error as before.
On 7/5/05, Chris Devers <[EMAIL PROTECTED]> wrote:
On Mon, 4 Jul 2005, Ken Killer wrote:

I load the config file in the main program using do,
<main.pl>
#!perl
do "conf";
use strict;
print "value of v is $v\n";
------------------------------------
and the config file has only one line,
<conf>
$v = 'hello';
Have you tried making that

my $v = 'hello';

?

When you `use strict`, you need to declare your variables.



--
Chris Devers


Reply via email to