Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

RE: RE: RE: variable comparison

by Simplicus (Monk)
on May 25, 2000 at 20:19 UTC ( [id://14793]=note: print w/replies, xml ) Need Help??


in reply to RE: RE: variable comparison
in thread variable comparison

Agreed. I've been brainwashed by Redmond to assume that an
extension is three characters long. My early DOS training
is to blame for that. (good ol' 8.3 notation, you know?)

Using a regex to hunt for the dot is out of the question,
because you might have a filename "foo.bar.htm" for example.
Of course, you could always look for the last instance of
the . in the filename, but . . . in the interst of having
clearer code, I like the substr approach better than the
regex (if only this once ;-) )

Replies are listed 'Best First'.
RE: RE: RE: RE: variable comparison
by mdillon (Priest) on May 25, 2000 at 20:28 UTC
    for finding the last instance of a string in another string, you can use rindex.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://14793]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-03-28 22:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found