in reply to split function using multiple delimiters
"it could't show the full content"Neither does your question provide "full content" when the phrase is used to mean "a clear description" of your problem.
The split you show, executed against the source string (presumptively $cont is the string you showed initially), produces an array as you appear to expect. The content of that array, via Data::Dumper, is:
$VAR1 = '<P_contrib-author>Allan Wigfield'; $VAR2 = ','; $VAR3 = ' Susan L. Klauda'; $VAR4 = ','; $VAR5 = ' '; $VAR6 = 'and'; $VAR7 = ' Jenna Cambria</P_contrib-author>';
So... is your question
WAG: You might find producing the desired output easier if you deal first with the tags and the substantive content. If your data is uniform -- contains (identical) <P_contrib-author> tags each time you need to extract authors -- identify, modify, and strip them out for your later use before dealing with the authors list.
But, I suspect the style of your data will vary from item to item... omitting the Harvard comma, using an ampersand instead of "and" and so on... so the overall solution won't be a single PATTERN for use in split, anyway.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: split function using multiple delimiters
by educated_foo (Vicar) on Dec 27, 2011 at 12:05 UTC | |
by Lotus1 (Vicar) on Dec 27, 2011 at 17:58 UTC | |
by JavaFan (Canon) on Dec 27, 2011 at 19:19 UTC | |
by educated_foo (Vicar) on Dec 27, 2011 at 21:00 UTC | |
by Anonymous Monk on Dec 28, 2011 at 08:10 UTC |