Syntactic Confectionery Delight | |
PerlMonks |
substitution of illegal chars in filenameby lahf (Initiate) |
on Oct 04, 2003 at 13:47 UTC ( [id://296504]=perlquestion: print w/replies, xml ) | Need Help?? |
lahf has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
How can i substitute part of a filename, that principally has reserved or alt codes for its handle? For instance: index.cgi%3Fsect = index.cgi?sectand the : or \ cant be read by windows properly, but linux can, as part of a filename, yeah i know windows translates it to the directory structure, but linux keeps it as part of a filename, and also other reserved characters too! So, I have the very basics of something, e.g. perl -pi~ -e 's/badcharshere/goodcharshere/g' filename.ext Now this is to translate whats inside the file, but not the filename. So I end up with bad links! Is there a script that does this already? Can anyone point me to it, please? Thanks ever so much for your time, effort and patience. lahf
Back to
Seekers of Perl Wisdom
|
|