#!/usr/bin/perl my $foo="|abcxyz||fiuhs|"; for (split(/\|/,$foo)) { print "field is [$_]\n"; }