problem with "our"

Discussion in 'Perl Misc' started by JaSeong Ju, Feb 5, 2004.

  1. JaSeong Ju

    JaSeong Ju Guest

    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
     
    JaSeong Ju, Feb 5, 2004
    #1
    1. Advertising

  2. JaSeong Ju wrote:

    > our $choice = 67.90;


    > Is perl version 5.005_03 too old?


    Yes. "our" was introduced in 5.6.

    sherm--
     
    Sherm Pendley, Feb 5, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andreas Suurkuusk
    Replies:
    0
    Views:
    4,001
    Andreas Suurkuusk
    Jul 27, 2003
  2. Ted Miller
    Replies:
    0
    Views:
    5,179
    Ted Miller
    Sep 13, 2003
  3. oyster
    Replies:
    12
    Views:
    408
  4. Venkatesh
    Replies:
    4
    Views:
    314
    Andrew Thompson
    Mar 1, 2007
  5. JaSeong Ju

    problem with "our"

    JaSeong Ju, Feb 5, 2004, in forum: Perl Misc
    Replies:
    1
    Views:
    129
    Aaron Sherman
    Feb 5, 2004
Loading...

Share This Page