in reply to can't use unpack or split??
How about this?
open FH, "<datafile"; while (my $line = <FH>) { chomp $line; my @a = ($line =~ /('{1}.*?'{1}(?=\s+)|\S+)/g); print join('|', @a) . "\n"; } close FH;
In Section
Seekers of Perl Wisdom
in reply to can't use unpack or split??
How about this?
open FH, "<datafile"; while (my $line = <FH>) { chomp $line; my @a = ($line =~ /('{1}.*?'{1}(?=\s+)|\S+)/g); print join('|', @a) . "\n"; } close FH;