Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Re: file case change

by ChOas (Curate)
on Mar 15, 2002 at 12:26 UTC ( #151966=note: print w/ replies, xml ) Need Help??


in reply to Re: file case change
in thread file case change

Okay:
change

for (readdir DIR) { print "$_<br>"; rename("$path/$_", lc("$path/$_")) or print "Couldn't rename $file +: $!\n"; }
to:
for (readdir DIR) { next if (/^\.{1,2}$/); print "$_<br>"; rename("$path/$_", lc("$path/$_")) or print "Couldn't rename $_: $ +!\n"; }

GreetZ!,
    ChOas

print "profeth still\n" if /bird|devil/;


Comment on Re: Re: file case change
Select or Download Code
Re: Re: Re: file case change
by tachyon (Chancellor) on Mar 15, 2002 at 20:34 UTC

    This is really bad code. First you lowercase the whole file path ensuring that any uppercase path will break this code (as when you lowercase it you will then try to write along a non existant path). Next you seem to have forgotten that '.' and '..' are not the only directories you might find. Finally you should never print unescaped arbitrary strings in HTML.

    cheers

    tachyon

    s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (8)
As of 2014-10-31 13:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (217 votes), past polls