develooper Front page | perl.perl5.porters | Postings from March 2003

Re: [PATCH] Re: [perl #18872] File::Basename example misleading

Thread Previous
March 2, 2003 15:09
Re: [PATCH] Re: [perl #18872] File::Basename example misleading
Message ID:
Richard Soderberg <> wrote:
:That's interesting; fileparse() accepts regexes for extensions, but 
:basename() specifically \Q\E's the input, to *ensure* it's not a regex. 
:  I've attached a patch against @18691 that updates the documentation, 
:at least.

Thanks, applied as #18810.

:> I myself would prefer to instead recognize that a regexp was passed 
:> in, and process in a way that that the given example with the 
:> suffixlist set to qr{\.pm} would return $basename as "Basename" I'm 
:> pretty sure the code today isn't doing what it should.
:Is there any reason to change this behaviour?  Why was it \Q\E'd in the 
:first place?

The docs say:
           The basename() routine returns the first element of
           the list produced by calling fileparse() with the same
           arguments, except that it always quotes metacharacters
           in the given suffixes.  It is provided for programmer
           compatibility with the Unix shell command basename(1).


Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About