my @fields = split /\|/, $line; #### my @a = $line =~ /([^\|]+)\|?/g;