Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help don't know perl

Status
Not open for further replies.

Wes12345

Programmer
Jun 28, 2004
2
US
Hi I am not a perl developer but I need to know what this line of code is doing. I do program in several other languages so I should understand what you are saying.
The form is passing in:

<INPUT TYPE="hidden" NAME="subject" value="Contact Us">
<INPUT TYPE="hidden" NAME="order" VALUE="fullname,address,city,state,zip,phone,e-mail,R1,S1">
<INPUT TYPE="hidden" NAME="redirect" VALUE="<INPUT TYPE="hidden" NAME="to" VALUE="april">

The error says april is not a registered user and here is the code that calls the error.

if( $alias{$in{'to'}} ) { $in{'to'} = $alias{$in{'to'}} }
else { &unknown_user( $in{'to'} ) }

Thanks so much for any help

Wes
 
I'm sorry, but we don't have enough information with what you send us...

But I would say that:
[ul]
[li]$in{to} correspond to the fourth input tag. It has 'april' as a value.[/li]
[li]if($alias{$in{to}}) tests if there is a value corresponding to $in{to} ('april') in the $alias varible (the %alias hash to be precise but if you don't know perl...)[/li]
[li]if it is, it puts the corresponding value into $in{to}[/li]
[li]if not it calls the unknown_user() function that most probably return you that error.[/li]
[li]so if you get an error, it's because 'april' is not in the %alias hash; this seams to mean that 'april' is not the correct value![/li]
[/ul]

Of course I'm not sure at all because of a lack of information... if you can give more... we will help more! :)
 
Perl will not return a direct answer such as "April is not a registered user" unless the script specifys that as a responce of a condition. Your code is basicalyy saying this:

if($alias is not false) then {$in{'to'} = Whatever alias is} else { call the subroutine &unknown_user }

I bet your problem is that you dont correctly pass the input from you HTML form into the script. So when you say if$alias{$in{'to'}} is not null, naturally it is because it was never assigned something. Then the script exectues the else whil probably has the custome error. Let me know if thats it, you may need to post some more code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top