in reply to word boundary match problem

Your inner while isn't doing what you want, and the outer one is badly formed. You have set up @source so that for is the loop you want. Match in list context will count the words on a line, so this will do:
my $size = 0; for (@source) { $size += () = m{\b\w+\b}g; }

After Compline,
Zaxo