You want to know about the /g modifier. Read about it in perldoc perlre:
Update: on a second reading you probably want (code updated to reflect the change):
#!/usr/bin/perl use strict; use warnings; while (my $line=<DATA>) { $line =~ s/\s+/|/ for 1..5; print $line; } __DATA__ This# is stand alone data "but this data needs to , sta +y together/ and here is some more -but this is a single column
In reply to Re: working with non-delimited files
by blazar
in thread working with non-delimited files
by semio
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |