Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Explanation from Perl Expert pls ....

Status
Not open for further replies.

hendnov

Technical User
Feb 27, 2006
73
AU
Hi guys,

I've got the perl code, here it is :

Code:
find . | perl –ne‘chomp();rename($_,lc($_))’

I know this code is for rename all the file to lower case recursively but could you guys explain exactly what chomp for ? and "$_" means ??

Thx guys
 
chomp removes newline characters (\n, \r) from the end of the variable (or in array context, the end of each array item). $_ is a default Perl variable for the current item in a loop.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top