NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
splitext is cleaner? (Score:3, Informative)
So yes, the default for python looks cleaner; but it's less flexible. In the best of all worlds: perhaps File::Basename::fileparse should default to the pattern "\..*" to be more DWIMy.
Come to think of it, is File::Basename that fugly as-is? Wouldn't something like:
($junk, $component, $flavour) = fileparse($file, "\..*");look clearer than:($component, $flavour) = $file =~ m{^.*/(.*)(\..*)$}; # extract suffix(speaking as somebody who knows no python; and hasn't used fileparse much. Maybe you had a reason to avoid fileparse I didn't see!)
-DA [coder.com]
Reply to This