Help for this page

Select Code to Download


  1. or download this
    %hash = (
        Name => 'myname',
        Number => 'my1234'.
        Rank => 'myrank',
    });
    
  2. or download this
    @hash{"Name", "Number", "Rank"} = ("Kakarot", "3", "SSJ3");
    
  3. or download this
    my @desc = ("Name", "Number", "Rank");
    my @vegeta = ("Vegeta", "2", "SSJ2");
    @hash{@desc} = @vegeta;
    
  4. or download this
    my %h = (
            Flinstones => {
    ...
                    print "\t\tValue => $h{$a}{$b}\n";
            }
    }
    
  5. or download this
    (#prints existing data fine but...)
    Key 1 => TEST
    Can't use string ("Mr") as a HASH ref while "strict refs" in use at sl
    +ice_hoh2.pl line
    
  6. or download this
    
    my $href = {
    ...
    
    my $desc = ["Dad", "Mom", "Kid", "Pet"];
    @{$href->{TEST}->{[@$desc]}} = ("Mr", "Mrs", "baby", "none");
    
  7. or download this
    Key 1 => TEST
    Can't use string ("Mr") as a HASH ref while "strict refs" in use at sl
    +ice_hoh2.pl line 35.
    
  8. or download this
    $h{TEST}{Dad} = "dad_TEST";
    $h{TEST}{Mom} = "mon_TEST";
    $h{TEST}{Kid} = "Kid_TEST";
    $h{TEST}{Pet} = "pet_TEST";
    
  9. or download this
    Family1   Dad1   Mom1   Kid1   Pet1
    Family2   Dad2   Mom2   Kid2   Pet2