Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl Misc (http://www.velocityreviews.com/forums/f67-perl-misc.html)
-   -   problem with "our" (http://www.velocityreviews.com/forums/t885024-problem-with-our.html)

JaSeong Ju 02-05-2004 04:05 PM

problem with "our"
 
Hi..

I'm new to perl.

How come this piece of code does not work in SunOs5.8, with perl v.
5.005_03 ?
--------------------
#!/usr/bin/perl

our $choice = 67.90;
print STDERR " value is: ", $choice, "\n";
exit(0);
-------------
The error is as follows:

Can't modify subroutine entry in scalar assignment at test6.pl line 3,
near "67.90;"
Execution of test6.pl aborted due to compilation errors.





The above script works well in Linux 2.4.20-8 kernel with perl v. 5.8.0.
Also, if "our" is replaced with "my", then script works in both operating
systems.

Is perl version 5.005_03 too old?

Many thanks.

JaSeong Ju


Sherm Pendley 02-05-2004 05:23 PM

Re: problem with "our"
 
JaSeong Ju wrote:

> our $choice = 67.90;


> Is perl version 5.005_03 too old?


Yes. "our" was introduced in 5.6.

sherm--



All times are GMT. The time now is 06:19 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.