in reply to Looking for elegant solution to dbi coding problem

Insted of
map { ... } split("\t", $line)
use
map { ... } $line =~ /(.*?)(?:\t|$)/g

>perl -le "@a = split(/\t/, """a\t"""); print scalar @a" 1 >perl -le "@a= """a\t""" =~ /(.*?)(?:\t|$)/g; print scalar @a" 2

Replies are listed 'Best First'.
Re^2: Looking for elegant solution to dbi coding problem
by duff (Parson) on Jul 15, 2005 at 22:52 UTC

    Or just the simpler split(/\t/,$line,-1)

    perldoc -f split