| 1 |
#!/usr/bin/env perl |
| 2 |
# pmcat -- page a module file |
| 3 |
|
| 4 |
# ------ pragmas |
| 5 |
use strict; |
| 6 |
use warnings; |
| 7 |
|
| 8 |
our $VERSION = '2.0.0'; |
| 9 |
|
| 10 |
# ------ define variables |
| 11 |
my $pager = undef; # $ENV{PAGER} - output paging program |
| 12 |
|
| 13 |
BEGIN { $^W = 1 } |
| 14 |
BEGIN { die "usage: $0 module ...\n" unless @ARGV } |
| 15 |
|
| 16 |
use FindBin qw($Bin); |
| 17 |
|
| 18 |
unless ($pager = $ENV{PAGER}) { |
| 19 |
require Config; |
| 20 |
$pager = $Config::Config{"pager"} || "more"; |
| 21 |
} |
| 22 |
|
| 23 |
exec "$pager `$^X -S $Bin/pmpath @ARGV`"; |
| 24 |
|
| 25 |
__END__ |
| 26 |
|
| 27 |
=head1 NAME |
| 28 |
|
| 29 |
pmcat - page through a module file |
| 30 |
|
| 31 |
=head1 DESCRIPTION |
| 32 |
|
| 33 |
Given a module name, figure out the path name and send |
| 34 |
that to the user's pager. |
| 35 |
|
| 36 |
$ pmcat CGI |
| 37 |
|
| 38 |
This works also on alternate installed versions of Perl: |
| 39 |
|
| 40 |
$ oldperl -S pmcat strict |
| 41 |
|
| 42 |
$ filsperl -S pmcat Threads |
| 43 |
|
| 44 |
This command is mostly here for people too lazy to type |
| 45 |
|
| 46 |
$ more `pmpath CGI` |
| 47 |
|
| 48 |
=head1 SEE ALSO |
| 49 |
|
| 50 |
pmpath(1) |
| 51 |
|
| 52 |
=head1 AUTHORS and COPYRIGHTS |
| 53 |
|
| 54 |
Copyright (C) 1999 Tom Christiansen. |
| 55 |
|
| 56 |
Copyright (C) 2006-2014 Mark Leighton Fisher. |
| 57 |
|
| 58 |
=head1 LICENSE |
| 59 |
|
| 60 |
This is free software; you can redistribute it and/or modify it |
| 61 |
under the terms of either: |
| 62 |
(a) the GNU General Public License as published by the Free |
| 63 |
Software Foundation; either version 1, or (at your option) any |
| 64 |
later version, or |
| 65 |
(b) the Perl "Artistic License". |
| 66 |
(This is the Perl 5 licensing scheme.) |
| 67 |
|
| 68 |
Please note this is a change from the |
| 69 |
original pmtools-1.00 (still available on CPAN), |
| 70 |
as pmtools-1.00 were licensed only under the |
| 71 |
Perl "Artistic License". |