#!/usr/bin/perl package TL::MyPackage; use warnings; use strict. our $VERSION = 1.0; sub new { my $class = shift; my $obj = [ @_ ]; return bless $obj, $class; } ... package main; use warnings; use strict; unless( __FILE__ =~ /\.pm$/ ) { # Skip if loaded as a module # Command-line interface require Getopt::Long; Getopt::Long->import( qw/GetOptions :config bundling/ ); my $verbose; GetOptions( 'verbose|v!' => \$verbose ) or die "Command error\n"; my $foo = TL::MyPackage->new( $verbose, ... ); print $foo->rub( 'lamp' ); ... exit(); } 1; #### mkdir -p /opt/sbin cp -p mycommand /opt/sbin/ mkdir -p /usr/lib/perl5/site_perl/5.99.0/TL ln -s ../../../../../../opt/sbin/mycommand \ /usr/lib/perl5/site_perl/5.99.0/TL/MyModule.pm