#!/usr/bin/perl use strict; use warnings; while (my $line=) { $line =~ s/\s+/|/ for 1..5; print $line; } __DATA__ This# is stand alone data "but this data needs to , stay together/ and here is some more -but this is a single column