The idea behind the ...
my $recipient = "root";
unless (defined($recipient)) { $recipient = "root" }
is that, if the user chooses not to edit the script and put their email address in the var $recipient, the mail would go to root by default. I guess my execution of that idea leaves something to be desired.
Thanks much for the regex/pack/substr reduction ... I was sure that there was a way to do that, but I just couldn't figure it out!