Hi,
I'm using the following global to alter the text printed within a page, dependent on the data within the field. I want to produce another text entry to be printed when the data in the field doesn't match any of those already programmed.
sub {
my $tags = shift;
my $text = $tags->{Field};
$text =~ s/[\s#]/, /g;
$text =~ s/data1/text1/;
$text =~ s/data2/text2/;
$text =~ s/data3/text3/;
$text =~ s/data4/text4/;
$text =~ s/data5/text5/;
my $output = $text;
return $output;
}
I want to add a line that would produce:
$text =~ s/empty or not listed above/text6/;
$text =~ s//text6/;
or $text =~ s/ /text6/;
and also tried using an else statement but am obviously not getting it right. Can anyone help?
Thanks
Alba
I'm using the following global to alter the text printed within a page, dependent on the data within the field. I want to produce another text entry to be printed when the data in the field doesn't match any of those already programmed.
sub {
my $tags = shift;
my $text = $tags->{Field};
$text =~ s/[\s#]/, /g;
$text =~ s/data1/text1/;
$text =~ s/data2/text2/;
$text =~ s/data3/text3/;
$text =~ s/data4/text4/;
$text =~ s/data5/text5/;
my $output = $text;
return $output;
}
I want to add a line that would produce:
$text =~ s/empty or not listed above/text6/;
$text =~ s//text6/;
or $text =~ s/ /text6/;
and also tried using an else statement but am obviously not getting it right. Can anyone help?
Thanks
Alba