Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jun 2010
    Posts
    12
    Thanks
    5
    Thanked 0 Times in 0 Posts

    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.

  • #2
    Super Moderator
    Join Date
    May 2005
    Location
    Southern tip of Silicon Valley
    Posts
    2,877
    Thanks
    2
    Thanked 164 Times in 159 Posts
    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.

  • Users who have thanked FishMonger for this post:

    Gino (04-04-2012)

  • #3
    New Coder
    Join Date
    Jun 2010
    Posts
    12
    Thanks
    5
    Thanked 0 Times in 0 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •