Help for this page

Select Code to Download


  1. or download this
    sub get_props {
        my $obj = shift;
    ...
    }
    my @meths = map { "get_value$_" } 1..3; # or whatever your methods are
    + really
    print "Values: @{[get_props($obj, @meths)]}\n"; # tweak to fit get_pro
    +ps()
    
  2. or download this
    package Object;
    use Hash::Util::FieldHash;
    ...
    }
    1;
    __END__
    
  3. or download this
    use Object;
    my $foo = Object->new;
    print "Values: ", join(", ", @$foo{qw(prop1 blorf)}),"\n";
    __END__
    Values: foo, 1492814598