[Chicago-talk] Problems with split (removing trailing fields)

Steven Lembark lembark at wrkhors.com
Tue Feb 24 22:55:54 CST 2004

-- Jay Strauss <me at heyjay.com>

> Hi,  I'm trying to parse a data stream whose delimiter is a chr(0).  The

One way to sanity check delimeters is to use a capturing
regex with split:

	my $delim = chr( 0 );

	my @result = split /($delim)/, $input;

This will give you an array which indludes the delimeters.
Normally this is nice for generating hashes out of input.
It is also handy for checking whether the fields got through.

Steven Lembark                               2930 W. Palmer
Workhorse Computing                       Chicago, IL 60647
                                            +1 888 359 3508

More information about the Chicago-talk mailing list