good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Filenames named "..\n"by zzspectrez (Hermit) |
on Aug 02, 2005 at 05:45 UTC ( [id://480083]=perlquestion: print w/replies, xml ) | Need Help?? |
zzspectrez has asked for the wisdom of the Perl Monks concerning the following question: In this node it was mentioned to me that the following code I wrote:
Will needlessly ignore filenames named "..\n". This would be obviously true, since I am matching the end with $ that matches the end of a string before a newline. So to fix this I believe changing the code to:
should fix it by matching at the end of the string. However, where exactly would this be a bug?? This would only be a bug on systems that support a newline in the filename. On windows, ( only system I have access to at the moment ) this is not an issue. You cannot create a filename with a "\n" within it. Example
Either filename will give an error: . So at least in windows this would not be a bug, since you would never encounter such a filename. Are there many systems that support such filenames?? I just can't see this being encountered often.. Am I missing something here?? zzSPECTREz
Back to
Seekers of Perl Wisdom
|
|