in reply to Foreach loop not working within Mail
A here-doc doesn't get executed. Variables within it are interpolated, but there's no execution. Massage the array first, then interpolate it, something like this:
I'm presuming the elements in @fwlog still have the newlines intact.splice(@fwlog, 15); # shorten array to max 15 elems foreach (@fwlog) { s/192\.168\.2\.3/x.x.x.x/; # dots should be escaped } # ... later ... print SENDMAIL <<EOM; .... Sample from the firewall logs: @fwlog EOM
HTH
|
|---|