Syntactic Confectionery Delight | |
PerlMonks |
Re^3: Extracting names from stringby dimar (Curate) |
on Feb 09, 2005 at 02:33 UTC ( [id://429284]=note: print w/replies, xml ) | Need Help?? |
A valid consideration. In fact you will notice I added the 'dot' (in addition to alphanumerics) simply because one was in the sample provided by the OP. The (simplifying) assumptions I enumerated were guesstimates. If we *really* wanted to be precise, we'd want both a spec and input validation (to know what flavor of xSV we were dealing with here, and to ensure user-data was 'scrubbed' before ever getting into the file/database/whatever to begin with) (for example, what happens in the alien case where you get a user who has a pipe or a slash in their name ... hmm ... isn't *slash* the name of some rock band dude ... I digress). You should know exactly what character sequences are in your delimiter-space, and what characters are in your message-space, and the two sets should be both finite and orthogonal. It's always a good reminder that (at least in production code) there should be none of this such 'guesswork' involved at all. ... but close enough for a tutorial on 'split'...
In Section
Seekers of Perl Wisdom
|
|