Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Renaming all files in a directory

by Anonymous Monk
on Feb 02, 2021 at 12:46 UTC ( #11127810=note: print w/replies, xml ) Need Help??


in reply to Re: Renaming all files in a directory
in thread Renaming all files in a directory

Why needs the counter be inside a BEGIN block?
  • Comment on Re^2: Renaming all files in a directory

Replies are listed 'Best First'.
Re^3: Renaming all files in a directory
by Cristoforo (Curate) on Feb 02, 2021 at 16:57 UTC
    In this example, perl is reading line by line, (perl -nle ...) and you want the counter to only be initialized (once) at the start of the script.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11127810]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2022-12-09 22:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?