use warnings; use strict; while (<>) { chomp; my ($name,@rest)= split(/\s*;\s*/,$_); foreach (@rest) { print $name,'; ',$_,"\n"; } }