split !! 
Author Message
 split !!

Hello, I have run into a little trouble here.
I have a database, made up like the following:

field:field:etc:etc:etc

Well, the split operation (a la split(/:/, $foobar)) works
quite nicely on this.  The trouble comes from the users here.

What if the use types in a : for part of his neato reply?
You guessed it! Ka-Boom.

I thought that I could do something like this:

print "Enter response: ";

...


print FILE $data.'\n';

...

Then to read it in:


This splits the lines appropriately, but there is a
character chopped off.

What I am looking for, is something like in lex:

[^\\]/: {split();}

Where the split will only be done if the perceading
character is not a \.

Any ideas?

--Toby.



Fri, 17 Feb 1995 01:22:31 GMT  
 split !!
If you can change the database file, you might want to use the $; char
as the field separator (generally bound to \034 or some such).  I've
change my database program (which uses dbm files so I don't care what
they look like) to use this instead of the ':' as originally intended
for this very reason.

ds
--

Dave Steiner

uucp: ...{backbone site}!rutgers!bakerst.rutgers.edu!steiner



Sun, 19 Feb 1995 09:49:50 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to use split function to split on a backslash

2. split inside split - can it be done ?

3. PERLFUNC: split - split up a string using a regexp delimiter

4. Help with split please - or maybe split isn't correct

5. Using split to return a @ without splitting on spaces

6. PERLFUNC: split - split up a string using a regexp delimiter

7. Splitting But NOT Splitting

8. Complicated pattern splitting in split

9. splitting, without losing the thing you split with

10. split with /s+/ vs. split with ' '

11. perl4.0.1.7 patch 34 "split" vs perl5.001e "split"

12. Split up a number? split? unpack?

 

 
Powered by phpBB® Forum Software