use strict; use warnings; my $i; while () { chomp; chop; s/\?'/'/g; $i = 0; map { print '['.$i++."]$_\n" } split(/\+/); } __DATA__ 0010+2+O?'Reilly' 012+90+Penguin'