opendir (DIR, "/home/costas/test") or die "cannot opendir dir"; foreach $file (readdir(DIR)) { rename($file, lc($file));
That doesn't work, because you get only the filenames from readdir and not their paths. You will have to prefix "/home/costas/test/" yourself:
my $path = '/home/costas/test'; opendir (DIR, $path) or die "Can't opendir: $!"; for (readdir DIR) { rename("$path/$_", "$path/" . lc); } closedir DIR;
U28geW91IGNhbiBhbGwgcm90MTMgY
W5kIHBhY2soKS4gQnV0IGRvIHlvdS
ByZWNvZ25pc2UgQmFzZTY0IHdoZW4
geW91IHNlZSBpdD8gIC0tIEp1ZXJk
In reply to Re: file case change
by Juerd
in thread file case change
by costas
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |