CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
AAARGH!!!!.... This Is FRUSTRATING!

 



kvall
New User

Aug 10, 2002, 3:35 PM

Post #1 of 3 (479 views)
AAARGH!!!!.... This Is FRUSTRATING! Can't Post

The following code works fine if I remove all mentions of $email.


foreach $result (@results){
chop $result;
($name, $year, $org, $email) = split /\~/, $result;
print "<tr><td>$name</td>\n";
print "<td>$year</td>\n";
print "<td>$org</td>\n";
print "<td><a href=mailto:$email>$email</a>\n";
print "</td></tr>\n";
}
print "</table>\n";


With $email in the code I get the following error message.

Use of uninitialized value in concatenation (.) or string at scripts\alphasearch.pl line 82

Line 82 is the first use of $email.

I am sure the problem is the @ sign contained in the value of $email,
I just don't know how to work around it.

Thanks in advance for your help.


(This post was edited by kvall on Aug 10, 2002, 3:40 PM)


kvall
New User

Aug 10, 2002, 4:29 PM

Post #2 of 3 (474 views)
Re: [kvall] AAARGH!!!!.... This Is FRUSTRATING! [In reply to] Can't Post

I made one small change and the code works.

I put the "mailto:" and the $email in separate print lines.
Like this:

print "<td><a href=mailto:";
print "$email>$email</a>\n";

Apparently it was NOT the @ sign but the : in the mailto: that was screwin the pooch.

But WHY????????


Paul
Enthusiast

Aug 11, 2002, 2:33 AM

Post #3 of 3 (469 views)
Re: [kvall] AAARGH!!!!.... This Is FRUSTRATING! [In reply to] Can't Post

It works fine for me although I think you want chomp $result and not chop (which will remove the end character).

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives