| 1 | #!/usr/local/bin/perl -w | ||||||||||
| 2 | # $Revision$$Date$ | ||||||||||
| 3 | # Robin's RCS header: | ||||||||||
| 4 | # RCSfile: rename.PL,v Revision: 1.3 Date: 2006/05/25 09:20:32 | ||||||||||
| 5 | # Larry's RCS header: | ||||||||||
| 6 | # RCSfile: rename,v Revision: 4.1 Date: 92/08/07 17:20:30 | ||||||||||
| 7 | # | ||||||||||
| 8 | # Log: rename,v | ||||||||||
| 9 | # Revision 1.5 1998/12/18 16:16:31 rmb1 | ||||||||||
| 10 | # moved to perl/source | ||||||||||
| 11 | # changed man documentation to POD | ||||||||||
| 12 | # | ||||||||||
| 13 | # Revision 1.4 1997/02/27 17:19:26 rmb1 | ||||||||||
| 14 | # corrected usage string | ||||||||||
| 15 | # | ||||||||||
| 16 | # Revision 1.3 1997/02/27 16:39:07 rmb1 | ||||||||||
| 17 | # added -v | ||||||||||
| 18 | # | ||||||||||
| 19 | # Revision 1.2 1997/02/27 16:15:40 rmb1 | ||||||||||
| 20 | # *** empty log message *** | ||||||||||
| 21 | # | ||||||||||
| 22 | # Revision 1.1 1997/02/27 15:48:51 rmb1 | ||||||||||
| 23 | # Initial revision | ||||||||||
| 24 | # | ||||||||||
| 25 | |||||||||||
| 26 | 7 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 27 | 7 | require File::Rename; | |||||||||
| 28 | 7 | require File::Rename::Options; | |||||||||
| 29 | 7 | ▶ | use Pod::Usage; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 30 | |||||||||||
| 31 | 7 | ▶ | main() unless caller; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 32 | |||||||||||
| 33 | sub main { | ||||||||||
| 34 | 11 | ▶ | my $options = File::Rename::Options::GetOptions() | ||||||||
|
Subroutine
main: called CC=7 SCAR=21.2
Branch: 1 branch
| |||||||||||
| 35 | or pod2usage; | ||||||||||
| 36 | |||||||||||
| 37 | 11 | ▶ | pod2usage( -verbose => 0, | ||||||||
|
Branch: 1 branch
| |||||||||||
| 38 | -exitval => 'NOEXIT', | ||||||||||
| 39 | -message => <<'MESSAGE', | ||||||||||
| 40 | -u|--unicode argument does not look like an encoding: | ||||||||||
| 41 | either give an encoding or put -e as next option | ||||||||||
| 42 | MESSAGE | ||||||||||
| 43 | ) if File::Rename::Options::bad_encoding($options); | ||||||||||
| 44 | |||||||||||
| 45 | 11 | ▶ | mod_version() if $options->{show_version}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 46 | 10 | ▶ | pod2usage( -verbose => 2 ) if $options->{show_manual}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 47 | 10 | ▶ | pod2usage( -exitval => 1 ) if $options->{show_help}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 48 | |||||||||||
| 49 | 10 | ▶ | @ARGV = map {glob} @ARGV if $^O =~ m{Win}msx; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 50 | |||||||||||
| 51 | 10 | File::Rename::rename(\@ARGV, $options); | |||||||||
| 52 | } | ||||||||||
| 53 | |||||||||||
| 54 | sub mod_version { | ||||||||||
| 55 | 1 | ▶ | print __FILE__; | ||||||||
|
Subroutine
mod_version: called CC=2 SCAR=7.0
| |||||||||||
| 56 | 1 | print ' using File::Rename version '. $File::Rename::VERSION; | |||||||||
| 57 | 1 | ▶ | print ', File::Rename::Options version '. $File::Rename::Options::VERSION | ||||||||
|
Branch: 1 branch
| |||||||||||
| 58 | if (eval $File::Rename::Options::VERSION) < (eval $File::Rename::VERSION); | ||||||||||
| 59 | # ignore $File::Rename::Unicode::VERSION | ||||||||||
| 60 | 1 | print "\n\n"; | |||||||||
| 61 | 1 | exit 0 | |||||||||
| 62 | } | ||||||||||
| 63 | |||||||||||
| 64 | 7 | 1; | |||||||||
| 65 | |||||||||||
| 66 | __END__ | ||||||||||