<?xml version="1.0" encoding="windows-1252"?>
<node id="997844" title="Re: How to call a function on each item after a split?" created="2012-10-08 11:56:16" updated="2012-10-08 11:56:16">
<type id="11">
note</type>
<author id="965102">
Kenosis</author>
<data>
<field name="doctext">
&lt;p&gt;Given your data set, another option is to use a regex to grab the items you want out of the string.  Consider the following:&lt;/p&gt;
&lt;c&gt;
use strict;
use warnings;

my $str = "item1  | item2| item3 |item4|";

my @items = $str =~ /\w+/g;

print "$_\n" for @items;
&lt;/c&gt;
&lt;p&gt;Output:&lt;/p&gt;
&lt;c&gt;
item1
item2
item3
item4
&lt;/c&gt;
&lt;p&gt;Hope this helps!&lt;/p&gt;</field>
<field name="root_node">
997827</field>
<field name="parent_node">
997827</field>
</data>
</node>
