Tuna has asked for the wisdom of the Perl Monks concerning the following question:
Here's how I intend on sending mailuse IO::File; my $fh = IO::File->new_tmpfile() || die "Can't make tmp file: $!"; my $FORMAT ="%-4s %-15s %-16s %-16s %-6s %-6s %-8s %s"; open (FILE, ">$fh")|| die "Can't open temp file: $!\n"; select ($fh); # this is an example of how I have coded all of my print statements ###################### # Print Router Table # ###################### print FILE <<TABLE The following table contains pertinent information regarding the routers listed in this flow request. TABLE ; printf FILE ($TAB, "Item", "Router", "Type", "IOS Version", "Memory", "Engine(s)", "\n"); printf FILE ($TAB, "====","================","====","===========", "=======","===========", "\n"); $counter = 0; foreach $key (sort keys %router_of_interest) { if (exists $version{$key} && $router_type{$key} && $memory{$key} && $engine{$key}) { $counter++; printf FILE ($TAB, "$counter.", "$key", "$router_type{$key}", "$version{$key}", "$memory{$key}K", "Engine $engine{$key}", "\n"); } }
My question is how do I accomplish using my temporary file, "FILE", as the text of an my email?open(MAIL,"|/usr/lib/sendmail -t") || die "Can't open sendmail: $!"; print MAIL <<REQUEST To: <me\@work.com> Subject:Flow Export Request - $request_date REQUEST ; close(MAIL);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using temporary file as body of email
by THRAK (Monk) on Apr 20, 2001 at 00:20 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |