Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: parse file name

by moritz (Cardinal)
on Sep 22, 2009 at 17:35 UTC ( #796774=note: print w/replies, xml ) Need Help??


in reply to Re: parse file name
in thread parse file name

Note that the notion of a "file extension" is a rather vague concept. For example in perl-5.10.1.tar.gz I would consider the .tar.gz to be the extension.

So if you want to DWIM, you'd have to keep a list of known file extensions that contain a dot, and special case them.

Replies are listed 'Best First'.
Re^3: parse file name
by MidLifeXis (Monsignor) on Sep 22, 2009 at 17:50 UTC

    Or you could consider it to be a recursive definition, so that .gz is the extension of the perl-5.10.1.tar, and .tar is the extension of perl-5.10.1.

    6 of one, 1/2 dozen of another.

    --MidLifeXis

    Please consider supporting my wife as she walks in the 2009 Alzheimer's Walk.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://796774]
help
Chatterbox?
[james28909]: well time/data stamp of the article
[stevieb]: james28909: what's the problem/question?
[james28909]: it is not an absolute date like "27" or "31". sometimes it is like wednesday or friday
[james28909]: and i need to format those special instances into an absolute date instead of "yesterday"
[stevieb]: ask a question on SoPW, and include at least a half-dozen examples of the input, and at least one example of expected output
[davido]: Exactly: SoPW. This isn't going to be solved easily in the CB.
[james28909]: in need "yesterday" and so on, to be absolute like "1" or "31"
[stevieb]: ...and throw some of your existing code into the equation as well, just so readers know you've given a try at it ;)
[james28909]: ok
[stevieb]: davido thanks for the link ;) I was being the typical lazy

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2017-04-29 02:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (531 votes). Check out past polls.