Go Back   CodingForums.com > :: Server side development > Perl/ CGI

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-04-2012, 09:06 AM   PM User | #1
Gino
New Coder

 
Join Date: Jun 2010
Posts: 12
Thanks: 5
Thanked 0 Times in 0 Posts
Gino is an unknown quantity at this point
Unreaded variable value - Help to find the mistake

Hello,

I'm using this code:
Code:
sub mailadd{
   $member_address_in = shift || $in{'address'};
   open (MAIL, "|$mailprog -t") || die "Can't open $mailprog!\n";
   print MAIL "From: $admin_email\n";
   print MAIL "To: $member_address_in\n";
   print MAIL "Subject: Newsletter - Confirmation\n\n";
   print MAIL <<to_the_end;
You subscribed to $list_name.
Best regards
to_the_end

  close (MAIL);

if ($sendto eq "1") {
open (MAIL, "|$mailprog -t") || die "Can't open $mailprog!\n";
   print MAIL "From: $admin_email\n";
   print MAIL "To: $admin_email\n";
   print MAIL "Subject: Mailing List Entry\n\n";
   print MAIL <<to_the_end;
$in{'address'} has been added to the $list_name.

to_the_end

  close (MAIL);
}
}
The problem is inside this piece of code:
Code:
if ($sendto eq "1") {
open (MAIL, "|$mailprog -t") || die "Can't open $mailprog!\n";
   print MAIL "From: $admin_email\n";
   print MAIL "To: $admin_email\n";
   print MAIL "Subject: Mailing List Entry\n\n";
   print MAIL <<to_the_end;
$in{'address'} has been added to the $list_name.

to_the_end

  close (MAIL);
}
It sends me an e-mail at each new follower.
I receive the mails with the following text: has been added to the newsletter.
So, $list_name is passed but the value of $in{'address'} is missing, where am I wrong ?

Do you have an idea ?
Thank you for your help.

Gino

Last edited by Gino; 04-04-2012 at 09:14 AM..
Gino is offline   Reply With Quote
Old 04-04-2012, 02:33 PM   PM User | #2
FishMonger
Super Moderator


 
Join Date: May 2005
Location: Southern tip of Silicon Valley
Posts: 2,753
Thanks: 2
Thanked 149 Times in 144 Posts
FishMonger will become famous soon enoughFishMonger will become famous soon enough
Where are you assigning $in{'address'}?

You need to add some debugging statements starting from that point (where you assigned the value) to see what's wrong.
FishMonger is offline   Reply With Quote
Users who have thanked FishMonger for this post:
Gino (04-04-2012)
Old 04-04-2012, 04:02 PM   PM User | #3
Gino
New Coder

 
Join Date: Jun 2010
Posts: 12
Thanks: 5
Thanked 0 Times in 0 Posts
Gino is an unknown quantity at this point
Quote:
Originally Posted by FishMonger View Post
Where are you assigning $in{'address'}?

You need to add some debugging statements starting from that point (where you assigned the value) to see what's wrong.
I found a workaround and I use now
Code:
$member_address_in has been added to the $list_name
instead of
Code:
$in{'address'} has been added to the $list_name
Thanks anyway for your help

Best regards
Gino is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:32 PM.


Advertisement
Log in to turn off these ads.