Help for this page

Select Code to Download


  1. or download this
    /* mytest.h */
    
    enum { a = 10, b, c, d, efg, hijk }; /* unnamed */
    enum Temperature { temp_low, temp_medium, temp_high };
    enum Othertest { frank, john, kurt, jason };
    
  2. or download this
    #!/usr/bin/env perl
     
    ...
    print $@ if $@;
    
    say "'kurt' is $C_ENUMS{kurt}";
    
  3. or download this
    'efg' is 14
    'kurt' is 2
    Modification of a read-only value attempted at mytest.pl line 22.
    'kurt' is 2
    
  4. or download this
    use strict;
    use warnings;
    ...
    
    say "efg  => ", efg;
    say "kurt => ", kurt;
    
  5. or download this
    efg  => 14
    kurt => 2