in reply to Iterating Through a Hash and Emailing the Result
Cheers - L~R#!/usr/bin/perl use strict; use warnings; use Mail::Mailer; my %hash = (foo => '3.14159265358', bar => '1.61803398874'); notify( \%hash ); sub notify { my $hash_ref = shift; my $mailer = Mail::Mailer->new("sendmail"); $mailer->open( { From => 'system@system.com', To => 'me@system.com', Subject => 'Warning', } ) or die "Can't open sendmail : $!"; for my $key ( keys %{ $hash_ref ) ) { print $mailer "$key : $hash_ref->{$key}\n"; } $mailer->close(); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Iterating Through a Hash and Emailing the Result
by bivouac (Beadle) on Mar 25, 2004 at 14:48 UTC |