Hi!
Unfortunately, we don't learn for what kind of environment you want it
*highlighted*. Is it a CGI/web site thing using <b> or <i> tags, or just a
plain text environment where you could "highlight" by putting _underscores_
or *asterisks* around the text or using CAPITALS.
The following subroutine, e.g., will highlight any occurance of the second
argument within the first argument by putting HTML <b>...</b> tags around
and then return the former with the highlights:
sub highlight
{
my $msg = shift;
my $tohilite = shift;
$msg =~ s|($tohilite)|<b>$1</b>|g;
return $msg;
}
- just change the '<b>$1</b>' to whatever kind of highlighting you prefer,
while $1 represents the part of the expression that is to be highlighted.
Regards
Sascha
----------
>Von: viswanathan sundararajan <[EMAIL PROTECTED]>
>An: [EMAIL PROTECTED]
>Betreff: Highlihting a string
>Datum: Fre, 20. Jul 2001 8:14 Uhr
>
> Hi,
> I want to highlight a string in my output.For
> example consider the output "welcome to perl".I want
> to highlight the string perl in this output.Could
> Anyone help me in this regard?
> visu
>
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]