- or download this
while ($s =~ /(.*?)\|(.*?)\|(.*?)\|/g) {
print "$1\t$2\t$3\n";
}
- or download this
while ($s =~ /((?:.*?\|){3})/g) {
print "$1\n";
}
- or download this
local $/ = "|"; # set input record separator
while (<>) {
print $_, scalar <>, scalar <>, "\n";
}
- or download this
local $/ = "|";
...
print;
print "\n" unless $. % 3;
}