Akhenaton has asked for the wisdom of the Perl Monks concerning the following question:
In the %mail hash, I am trying to use the above defined vars $fname and $emailaddy - however I am getting the following error:sub manually_page { system("/bin/bash -c clear"); my $wnum = &UnixDate( "today", "%U" ); # defines the week number f +or the current week 1 - 53 my $sched = new Schedule::Oncall; #open(SESAME, "sbur.sched.$wunm"); if ( defined(open(SESAME, "sbur.sched.$wnum")) ) { my @sched = $sched->load ("file" => "sbur.sched.$wnum"); my $oncall = $sched->oncall (time); my %info = $sched->info ("$oncall"); my $person = $sched->oncall (time); my $pemail = $info{pager}->[0]; # assigned oncall pager email my $fname = $info{fullname}->[0,1]; # assigns the full name of + who's oncall my $emailaddy = $info{email}->[0]; # assigns the email of who' +s oncall } else { print "There isn't a sched file defined!\n"; } my %mail = ( To => "$fname <$emailaddy>", From => 'oncall script <oncall.pl@dcx.com>', Subject => 'Test message yepper', 'X-Mailer' => "Mail::Sendmail version $Mail::Sendmail::VERSION +", );
I bet it's simple, but being new, I am having a hard time figuring it out, I greatly appreciate any help. -AkhenatonGlobal symbol "$fname" requires explicit package name at ./oncall.pl l +ine 69. Global symbol "$emailaddy" requires explicit package name at ./oncall. +pl line 69
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: hash question
by Roy Johnson (Monsignor) on Jun 29, 2006 at 14:26 UTC | |
by ikegami (Patriarch) on Jun 29, 2006 at 15:36 UTC | |
by Akhenaton (Initiate) on Jun 29, 2006 at 14:47 UTC | |
|
Re: hash question
by artist (Parson) on Jun 29, 2006 at 14:26 UTC |