in reply to Printing Data to Email body from Perl

This snippet might be helpful, and there are modules for checking lists.
#!/usr/bin/perl my @a = qw(a b c d e f); my @b = qw(c d e f g h); my ($only_a, $only_b, $both, $either) = listy(\@a, \@b); print "only in a: @$only_a\n"; print "only in b: @$only_b\n"; print "both: @$both\n"; print "either: @$either\n"; sub listy { my %tmp1; for (0..1) { for my $k (@{$_[$_]}) { $tmp1{$k} .= $_; } } my %tmp2; while (my($k, $v) = each %tmp1) { push @{$tmp2{$v}}, $k; } return @tmp2{"0", "1", "01"}, [keys %tmp1]; }

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh

Replies are listed 'Best First'.
Re^2: Printing Data to Email body from Perl
by Anonymous Monk on Oct 17, 2011 at 16:52 UTC

    Hi,

    Thank you for the code snippet but I am looking for something which can go with the exsisting script rather than new one. so is it possible to extend the current script

      I'm sure you have already looked at the Email modules that CPAN provides. Please tell us why the modules are unsatisfactory and didn't do what you needed. Particularly, MIME::Lite works very well in sending emails.

      If you have other questions than how to send mail from a Perl script, maybe you should make that clearer in your post.

      Also note that we expect you to do your own work. This is not a script writing service, so "something which can go with the existing script" will have to be something you write from the solutions you find.