Perl Cramp

Dave Helton dave at KD0YU.COM
Sat Oct 22 20:52:21 IST 2011


Phil,

Looks like you need to escape the indirections... i.e.

$text =~ s/\<(html\S+)\>(\S+)/$1$html$2/i;

Of course this is a quick response and has not been tested ;)

--Dave


From: mailscanner-bounces at lists.mailscanner.info [mailto:mailscanner-bounces at lists.mailscanner.info] On Behalf Of --[ UxBoD ]--
Sent: Saturday, October 22, 2011 2:01 PM
To: MailScanner discussion
Subject: OT: Perl Cramp

All,

I am trying to resolve an issue with the MailScanner and ZendTo integration around how Outlook constructs HTML emails.  My problem is brain cramping on Perl. Here is a code snippet:

!/usr/bin/perl

my $text = "<HTML 123>This is a test</HTML>";
my $html = "Add this first";

$text =~ s/(<html\S+)>(\S+)/$1$html$2/i;

print $text . "\n";


What I need to happen is that $html gets inserted before <HTML 123> and keep every else as it.  Hopefully a Perl guru will put me straight!
--
Thanks, Phil


--
This message has been scanned for viruses and
dangerous content by MailScanner<http://www.mailscanner.info/>
running on mail server KD0YU.COM<http://www.kd0yu.com/>, and is believed to be clean.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner at KD0YU.COM, and is
believed to be clean.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.mailscanner.info/pipermail/mailscanner/attachments/20111022/f34149c8/attachment.html


More information about the MailScanner mailing list