- or download this
sub make_sub {
my ( $sub_name, $code ) = @_ ;
...
say_hello( 'World' );
__END__
Hello World
- or download this
package MyFunctions;
# save this as MyFunctions.pm
...
1;
- or download this
#!/usr/bin/perl
# save this as program.pl
...
chomp( my $arg = <STDIN> );
MyFunctions->$action( $arg );
- or download this
$ perl program.pl
action> list_dir
...
foo
bar
baz