| 1 | #!/usr/local/bin/perl | ||||||||||
| 2 | 7 | ▶ | use 5.032; # use strict; use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | |||||||||||
| 4 | 7 | ▶ | use File::Rename qw(:config no_require_order); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 7 | ▶ | use Pod::Usage; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 7 | ▶ | main() unless caller; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 8 | |||||||||||
| 9 | 12 | ▶ | sub main { | ||||||||
|
Subroutine
main: called CC=7 SCAR=20.6
| |||||||||||
| 10 | 12 | ▶ | my $options = File::Rename::Options::GetOptions() | ||||||||
|
Branch: 1 branch
| |||||||||||
| 11 | or pod2usage; | ||||||||||
| 12 | |||||||||||
| 13 | 12 | ▶ | pod2usage( -verbose => 0, | ||||||||
|
Branch: 1 branch
| |||||||||||
| 14 | -exitval => 'NOEXIT', | ||||||||||
| 15 | -message => <<'MESSAGE', | ||||||||||
| 16 | -u|--unicode argument does not look like an encoding: | ||||||||||
| 17 | either give an encoding or put -e as next option | ||||||||||
| 18 | MESSAGE | ||||||||||
| 19 | ) if File::Rename::Options::bad_encoding($options); | ||||||||||
| 20 | |||||||||||
| 21 | 12 | ▶ | mod_version() if $options->{show_version}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | 11 | ▶ | pod2usage( -verbose => 2 ) if $options->{show_manual}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | 11 | ▶ | pod2usage( -exitval => 1 ) if $options->{show_help}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 24 | |||||||||||
| 25 | 0 | ▶ | @ARGV = map {glob} @ARGV if $^O =~ m{Win}msx; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.2
Branch: 1 branch
| |||||||||||
| 26 | |||||||||||
| 27 | 11 | File::Rename::rename(\@ARGV, $options); | |||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | 1 | ▶ | sub mod_version { | ||||||||
|
Subroutine
mod_version: called CC=3 SCAR=11.1
| |||||||||||
| 31 | 1 | print __FILE__; | |||||||||
| 32 | 1 | my $version = File::Rename->VERSION; | |||||||||
| 33 | 1 | my $opt_ver = File::Rename::Options->VERSION; | |||||||||
| 34 | 1 | print ' using File::Rename version '. $version; | |||||||||
| 35 | 1 | ▶ | if( (eval $opt_ver) < (eval $version) ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 36 | 1 | ▶ | $opt_ver .= '.00' unless $opt_ver =~ m{\.}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 37 | 1 | print ', File::Rename::Options version '. $opt_ver; | |||||||||
| 38 | } | ||||||||||
| 39 | # ignore File::Rename->VERSION | ||||||||||
| 40 | 1 | print "\n\n"; | |||||||||
| 41 | 1 | exit 0 | |||||||||
| 42 | } | ||||||||||
| 43 | |||||||||||
| 44 | 7 | 1; | |||||||||
| 45 | |||||||||||
| 46 | __END__ | ||||||||||