Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    sub bar { my $self =shift; warn "bar: @_\n" }
    sub baz { my $self =shift; warn "baz: @_\n" }
    
  2. or download this
    foo: 0
    bar: 1
    baz: 2
    
  3. or download this
    
    my %meth = ( foo => "foo" );
    
    $o->${\ $meth{foo} }($count++);
    
  4. or download this
    use constant {
      STUFF => {
    ...
    my $key = "BAR";
    
    $o->${ \ STUFF->{$key} }($count++);