in reply to Format text problem
The first return you hit is the only one that executes. Concatenate all your strings and make a single return with them. It is sufficient to make the concatenation the last statement in the sub. Here's one way to write it,
I've removed the use of variables from outside the sub, so you'll now need to call it with arguments to get the values inside. That helps prevent some hard to find bugs that may crop up with lexical closures or uninitialized globals.sub format_email_text { my ($player, $parent, $memberid) = @_; sprintf "%-30s %-50s\n" x 3, 'Player Name:', $player, 'Parent\'s Name:', $parent, 'Member ID:', $memberid; }
After Compline,
Zaxo
|
|---|