Help for this page

Select Code to Download


  1. or download this
    sub one {
        my ($self, $value) = @_;
    ...
        return $self->{two} // 2;
    }
    # and so on...
    
  2. or download this
    package Dynamic;
    
    ...
    
    1;
    __END__
    
  3. or download this
    use warnings;
    use strict;
    ...
        }
        printf "sub $_: %d\n", $dyn->$_();
    }
    
  4. or download this
    spek@scelia ~/repos/scripts/perl/dynamically_auto_generate_subs $ perl
    + dyn.pl
    
    ...
    sub three: 99
    sub four: 4
    sub five: 5
    
  5. or download this
    BEGIN {
        # Auto generate the stdout() and stderr() methods, and their priva
    +te
    ...
            };
        }
    }