Re: Renaming all files in a directory -- perl -n -p and empty files onelinerby Discipulus (Abbot)
|on Feb 02, 2021 at 11:35 UTC||Need Help??|
you can avoid the oneliner BEGIN block using the Maori-farewell like in perl -M'5; $counter=0' -nle ...
But you can avoid the counter at all:
PS you get the filename currently processed in $ARGV so you can play with it:
PPS note that perl -n and perl -p both skip empty files!
PPPS after choroba's nice below response I cant resist to update the title and to try it:
There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.