perl C:\Perl-Tools\tile_counter.pl --dir=%folder2delete%\%%n\ --file=*.png
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
#!/usr/bin/perl use strict; use warnings; use 5.010; use Cwd; use File::Spec; use Getopt::Long; use File::Find::Rule; $| = 1; my $PROGNAME = ( split m|[\\/]|, $0 )[-1]; help() if !@ARGV; my ( @filemask, @dir ); my ( $wiki_output, $help ); GetOptions( "f|file=s" => \@filemask, # filemasks to select several files (DEFAULT: all files) "d|dir=s" => \@dir, # dirs for scan (DEFAULT: current dir) "wiki" => \$wiki_output, # report in wiki-format (DEFAULT: off) "h|help" => \$help # show help ) or die "Error in command line arguments\n"; ### set defaults of parameters if not already set push @dir, Cwd::cwd() if not @dir; # use current dir, if no parameter --dir defined $wiki_output //= 0; help() if $help; ..
perl C:\Perl-Tools\tile_counter.pl --from=10 --to=20 --dir=%folder2delete%\%%n\ --file=*.png
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
#!/usr/bin/perl use strict; use warnings; use 5.010; use Cwd; use File::Spec; use Getopt::Long; use File::Find::Rule; $| = 1; my $PROGNAME = ( split m|[\\/]|, $0 )[-1]; help() if !@ARGV; my ( @filemask, @dir ); my ( $wiki_output, $help, $from, $to); GetOptions( "f|file=s" => \@filemask, # filemasks to select several files (DEFAULT: all files) "d|dir=s" => \@dir, # dirs for scan (DEFAULT: current dir) "wiki" => \$wiki_output, # report in wiki-format (DEFAULT: off) "f|from=i" => \$from, # zoom level FROM (or min) "t|to=i" => \$to, # zoom level TO (or max) "h|help" => \$help # show help ) or die "Error in command line arguments\n"; ### set defaults of parameters if not already set push @dir, Cwd::cwd() if not @dir; # use current dir, if no parameter --dir defined $wiki_output //= 0; help() if $help; for my $i ($from .. $to) { print "$i\n"; }
1
2
3
4
5
6
"f|file=s" => \@filemask, # filemasks to select several files (DEFAULT: all files)
"d|dir=s" => \@dir, # dirs for scan (DEFAULT: current dir)
"wiki" => \$wiki_output, # report in wiki-format (DEFAULT: off)
"f|from=i" => \$from, # zoom level FROM (or min)
"t|to=i" => \$to, # zoom level TO (or max)
"h|help" => \$help # show help
1 2 3 4 5
my $DEBUG = 1; $DEBUG && say '------------------------------'; $DEBUG && say $from; $DEBUG && say $to; $DEBUG && say '------------------------------';