in reply to italicize an email message

Just one word? Regexp is your solution. I assume you're using HTML output?
open(FILE, "file.txt") or die "$!"; while (<FILE>) { $_ =~ /$word/<em>$word</em>/; } print $_; close(FILE);
Disclaimer: This code hasn't been tested!

--Coplan

Replies are listed 'Best First'.
Re: Re: italicize an email message
by feanor_269 (Beadle) on Apr 09, 2003 at 19:27 UTC
    perhaps  $_ =~ /$word/<em>$word</em>/; should be   $_ =~ s/$word/<em>$word</em>/;

    feanor_269

      Well ... it should be $_ =~ s/\Q$word\E/<em>$word</em>/g;

      Jenda
      Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
         -- Rick Osborne

      Edit by castaway: Closed small tag in signature

Re: Re: italicize an email message
by Anonymous Monk on Apr 10, 2003 at 14:32 UTC
    I'm not using HTML as my output....I'm not sure exactly how or why I should? Let me explain a little better my problem. There is this mass email that has to be sent out to various people within my company. The message I have to send has a word that needs to be italicized. I am using NET::SMTP to send the email so the message is just text. thanks again

      That's the point others are trying to make: you can't use italics in a plain text message. To do so, you either need HTML, or RTF, or something similar. You can send a multipart email using MIME, but again, the plain text portion will not have any font formatting, only the HTML or RTF portion.