Help for this page

Select Code to Download


  1. or download this
    use constant D50 => [96.42, 100, 82.49];
    
  2. or download this
    sub D50 () { [96.42, 100, 82.49] }
    
  3. or download this
    use Readonly;
    Readonly::Array my @D50 => (96.42, 100, 82.49);
    ...
    __END__
    96.42
    Modification of a read-only value attempted at ...
    
  4. or download this
    BEGIN {
        my $x = [96.42, 100, 82.49];
        *D50 = sub () { $x };
    }
    
  5. or download this
    use constant D50 => (96.42, 100, 82.49);
    
  6. or download this
    $ perl -MO=Deparse -e 'use constant X=>[1]; print X->[0]++; print X->[
    +0]++'
    use constant ('X', [1]);
    ...
    $ perl -le 'use constant X=>[1]; print X->[0]++; print X->[0]++'
    1
    2