perl bug File::Basename and Perl's nature

Walter Roberson roberson at
Mon Jan 26 19:32:42 CET 2004

In article <7fe97cc4.0401260943.2442ba4e at>,
Xah Lee <xah at> wrote:
:* when it gets one to think about design, File::Basename is one
:fucking turd. The suffix list should not be regex in the first fucking
:place. (it shouldn't even require a suffix list by default). The need
:to feed it OS type (fileparse_set_fstype($os)) is fucking defeating
:the main point of using this module.

You don't -need- to feed it the OS type: it defaults to using
the information from the currently running OS ($^O). The
fileparse_set_fstype is there so that one can write routines targetted
at specific OSes. For example, one could import a VMS log file onto
a Unix system and parse it there without having to roll one's own
filename parsing routines.

:The suffix list should not be regex in the first fucking

Why not? Anyone who read the documentation would see immediately that
regexes were called for in that position. Perhaps -you- don't need
the flexibility of having regexes there, but is that any reason to
deny other people the flexibility?

:it shouldn't even require a suffix list by default

It doesn't. If you don't pass it a suffix list, then that will be
treated as the empty array, and suffixes will not be broken out.

Are you perhaps saying that on Unix systems, it should default to
using '\.[^.]*$' as the suffix list, thus breaking out from the
last period onwards?
   Beware of bugs in the above code; I have only proved it correct,
   not tried it.                             -- Donald Knuth

More information about the Python-list mailing list