El Domingo 08 Julio 2007 19:25, kilaru rajeev escribió: > Hi Ken, > > I have removed the *strict.* But, got the output like this: > > Name "main::varl" used only once: possible typo at sample.pl line 3. > Name "main::var1" used only once: possible typo at sample.pl line 2. > Use of uninitialized value in concatenation (.) or string at sample.pl line > 3. > Thanks, > Rajeev > > On 7/8/07, Ken Foskey <[EMAIL PROTECTED]> wrote: > > On Sun, 2007-07-08 at 22:27 +0530, kilaru rajeev wrote: > > > Hi, > > > > > > Please explain me whats wrong with the following code as it is > > > respondingwith the some errors. > > > > > > #!/usr/bin/perl -w > > > use strict; > > > > # Since you are use strict you must declare all variables before using # > > them. This prevents typos. > > > > my ($var1, $var2); > > > > > $var1 = 'Hello World'; # always wanted to do that :-) > > > $var2 = "$var1\n"; > > > print $var2; > > > exit; > > > > > > output: > > > Global symbol "$var1" requires explicit package name at sample.pl line > > > > 3. > > > > > Global symbol "$var2" requires explicit package name at sample.pl line > > > > 4. > > > > > Global symbol "$var1" requires explicit package name at sample.pl line > > > > 4. > > > > > Global symbol "$var2" requires explicit package name at sample.pl line > > > > 5. > > > > > Execution of sample.pl aborted due to compilation errors. > > > > > > Thanks, > > > Rajeev Kilaru > > > > -- > > Ken Foskey > > FOSS developer > > > > > > -- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > http://learn.perl.org/
This isn't an error, but is a warning saying $var1 is used only once so may be there's an error on the variable name. But if you're sure there's no mistake just ignore the warning. Cheers, -- Xavier Mas -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/