in reply to Re^2: Bad code from the trenches
in thread Bad code from the trenches

Define "reasonable" in a platform-independent way. Or, is this something that should be included in File::Spec? Who gets to make that list?

In other words, /dev is perfectly reasonable on Win32 and /Windows is perfectly reasonable on Linux. Now what?

Being right, does not endow the right to be rude; politeness costs nothing.
Being unknowing, is not the same as being stupid.
Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

Replies are listed 'Best First'.
Re^4: Bad code from the trenches
by itub (Priest) on Mar 18, 2005 at 20:37 UTC
    Who says it must be platform independent? Not every script ever written needs to be portable. What is reasonable depends on the application, so I don't think it's something you can put on File::Spec.

    For example, if you are writing a CGI that is supposed to serve a file to the user, you can probably have all such files confined to a specific directory, and allow only relative filenames that don't contain double dots. To be on the safe side, I would constrain the filename to the smallest possible set of characters, such as /^\w+$/. But again, it depends on the application.