Help for this page

Select Code to Download


  1. or download this
    my %hash = (
        myvar => 3,
        name  => 'Ovid',
    );
    print $hash{name};
    
  2. or download this
    use constant NAME => 2;
    print $array[NAME];
    
  3. or download this
    #!/usr/bin/perl
    use warnings;
    use strict;
    ...
    print $var;
    
    sub alias_to { $_[0]->[$_[1]] }