Hello:
I have a piece of code which holds values in an array. I want to format the results when they are being called to print. Right now, it just prints the name and the value for that name. Example: email: test@email.com.
I would like to at least make the word "email" appear in bold or capitalize the first letter.
How do I do that? Thank you in advance for all the help. I posted all portions of the code which leads up to the final printing. I believe this is the line of code which prints the results: return ("$name: ", $value);
sub send_main_email_body_header {
my ($self, $date) = @_;
my $dashes = '-' x 75;
$dashes .= "\n\n" if $self->{CFG}{double_spacing};
$self->mailer->print(<<END);
This is the information which was submitted.
END
}
sub send_main_email_print_config {
my ($self) = @_;
if ($self->{FormConfig}{print_config}) {
foreach my $cfg (@{ $self->{FormConfig}{print_config} }) {
if ($self->{FormConfig}{$cfg}) {
$self->mailer->print("$cfg: $self->{FormConfig}{$cfg}\n");
$self->mailer->print("\n") if $self->{CFG}{double_spacing};
}
}
}
}
sub send_main_email_fields {
my ($self) = @_;
foreach my $f (@{ $self->{Field_Order} }) {
my $val = (defined $self->{Form}{$f} ? $self->{Form}{$f} : '');
$self->send_main_email_field($f, $val);
}
}
sub send_main_email_field {
my ($self, $name, $value) = @_;
my ($prefix, $line) = $self->build_main_email_field($name, $value);
my $nl = ($self->{CFG}{double_spacing} ? "\n\n" : "\n");
if ($self->{CFG}{wrap_text} and length("$prefix$line") > $self->emai
+l_wrap_columns) {
$self->mailer->print( $self->wrap_field_for_email($prefix, $line)
+. $nl );
}
else {
$self->mailer->print("$prefix$line$nl");
}
}
sub build_main_email_field {
my ($self, $name, $value) = @_;
return ("$name: ", $value);
}
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.