good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
at first :
and then, later , in sub_usage : where do you really want to die? :-) Aside from this, I've always interpreted "base filename" and "extention" to be 2 particular and discrete things, so if you do have a file named foo.bar.baz.quux, you've got a base filename of "foo.bar.baz" and an extention of "quux"; do you have a particular need or use to split on every dot, or were you being (lowercase) lazy? in any case, it really seems like you're doing too much work here. Additionally, I would not use any module that required me to declare a DEBUG variable (or constant, in this case) in my own package, but perhaps this could be addressed if you make your File::Basename::foo package. File::Basename::foo::DEBUG would be ok with me. here's a AWTDI, using sexegers, for comparison.
Update : You could also reverse and split /./,$_,2 rather than use the regex in the unless line... so many ways... :-) In reply to Re: Parse out the extension of a filename - return base of filename. (boo)
by boo_radley
|
|