http://www.perlmonks.org?node_id=1210502


in reply to regex problem

HERE! If it's only printing like that, you worry about I would recommend this short piece of code!
while ($line=<DATA>) { my @items = split /\s+/,$line; $items[1] =~ s/\-/\n$items[0] /g; print join " ",@items,"\n"; }