split/Perl question

der.hans plug-discuss@lists.plug.phoenix.az.us
Mon, 11 Nov 2002 13:49:40 -0700 (MST)


Am 11. Nov, 2002 schw=E4tzte Mike Starke so:

> Yes, in this particular case, it is the URL. Your suggestion sounds
> like a good work around in this case, but what happens if another field
> contains a colon? That is my problem.
>
> I was kind of hoping for a solution that would take advantage of the
> fact that I have a fixed amount of fields.

If they can be anywhere, "Hi! My name's V:NC3NT FURN:3R[0].", then you prob=
ably
have to handparse the lines that have too many colons in them. You might be
able to autogically detect the most common, e.g. http://.

Use David's "how many colons did I get?" algorithm to find out if you need
to care. For future stuff get the cgi fixed. What I often do is use double
or triple colons as the delimiter, then disallow that many in input. Guess =
I
could still get bit by "V:NN: FURN:3R", who would become "V:NN IFURN:3R" if
fname and lname were stored in that order.

ciao,

der.hans

[0] Sorry, I suck at l33t sp3ak.
--=20
#  https://www.LuftHans.com/    http://www.TOLISGroup.com/
#  "The purpose of IT is to seamlessly and transparently provide the other
#  9/10's of the [iceberg] for people who need to work with chunks
#  of floating ice." -- Strata Rose Chalup