D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
usr
/
share
/
doc
/
perl-Getopt-Long
/
examples
/
Filename :
skel1.pl
back
Copy
#!/usr/bin/perl -w # Skeleton for an application using Getopt::Long. # Author : Johan Vromans # Created On : Tue Sep 15 15:59:04 1992 # Last Modified By: Johan Vromans # Last Modified On: Fri Jul 9 14:28:48 2010 # Update Count : 43 # Status : Unknown, Use with caution! ################ Common stuff ################ use strict; # Package or program libraries, if appropriate. # $LIBDIR = $ENV{'LIBDIR'} || '/usr/local/lib/sample'; # use lib qw($LIBDIR); # require 'common.pl'; # Package name. my $my_package = 'Sciurix'; # Program name and version. my ($my_name, $my_version) = qw( MyProg 0.01 ); ################ Command line parameters ################ use Getopt::Long 2.13; # Command line options. my $verbose = 0; # verbose processing # Development options (not shown with -help). my $debug = 0; # debugging my $trace = 0; # trace (show process) my $test = 0; # test mode. # Process command line options. app_options(); # Post-processing. $trace |= ($debug || $test); ################ Presets ################ my $TMPDIR = $ENV{TMPDIR} || $ENV{TEMP} || '/usr/tmp'; ################ The Process ################ exit 0; ################ Subroutines ################ sub app_options { my $help = 0; # handled locally my $ident = 0; # handled locally # Process options, if any. # Make sure defaults are set before returning! return unless @ARGV > 0; if ( !GetOptions( 'ident' => \$ident, 'verbose' => \$verbose, 'trace' => \$trace, 'help|?' => \$help, 'debug' => \$debug, ) or $help ) { app_usage(2); } app_ident() if $ident; } sub app_ident { print STDERR ("This is $my_package [$my_name $my_version]\n"); } sub app_usage { my ($exit) = @_; app_ident(); print STDERR <<EndOfUsage; Usage: $0 [options] [file ...] -help this message -ident show identification -verbose verbose information EndOfUsage exit $exit if defined $exit && $exit != 0; }
Name
Size
Last Modified
Owner
Permissions
Actions
README
0.314
KB
July 23 2006 2:34:06
root
0644
parsetime.pl
1.189
KB
October 08 2004 11:40:22
root
0644
skel1.pl
1.971
KB
April 19 2011 7:07:03
root
0644
skel2.pl
2.556
KB
June 02 2015 8:40:04
root
0644
skel3.pl
2.523
KB
July 09 2010 12:30:13
root
0644
skel4.pl
2.755
KB
July 04 2013 12:43:40
root
0644
2017 © D7net | D704T team