in reply to parse array to replace specific spaces with pipes

join() to the rescue

while (@row = $sth->fetchrow_array) { print OUTFILE '|',join('|',@row),"|\n"; }

Replies are listed 'Best First'.
Re^2: parse array to replace specific spaces with pipes
by johngg (Canon) on Jul 10, 2009 at 09:36 UTC
    print OUTFILE '|',join('|',@row),"|\n";

    You could let join do all the work.

    print OUTFILE join '|', '', @row, "\n";

    I hope this is of interest.

    Cheers,

    JohnGG

      Join is very good. :) Thanks Jethro and Johngg