Help for this page

Select Code to Download


  1. or download this
    my @attribute_names = ('attr1', 'attr2', 'attr3');
    foreach my $attribute (@attribute_names) {
        my $value = $self->get($attribute);
        print "$attribute => $value\n";
    }
    
  2. or download this
    my @attribute_names = ('attr1', 'attr2', 'attr3');
    foreach my $attribute (@attribute_names) {
    ...
        my $value = $self->$function_name;
        print "$attribute => $value\n";
    }
    
  3. or download this
    my @attr_names = ('attr1', 'attr2', 'attr3');
    my @values = $self->get(@attr_names);
    print "$attr_names[$_] => $values[$_]\n" for (0 .. $#attr_names);
    
  4. or download this
    FooClass->define_attributes(
        foo => { Type => 'MULTIPLE(x)', Default => 0 },
    );