Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Mon Dec 15, 2008 3:47 am   

[3.03] PerlScript not working correctly?
 
Yeah, I'm going back on about the PerlScript. I have the following script:

Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <alias name="sendmail" copy="yes">
    <value><![CDATA[# Debug start
#$sess->EchoStr("!!!! start !!!!",15);

user Mail:SendEasy;

#get vars from CMUD
$password=$sess->GetVar("send_password","PerlScript|Email")->Value;
$mail_to_user=$sess->GetVar("mail_to_users","PerlScript|Email")->Value;
$mail_to_domain=$sess->GetVar("mail_to_domain","PerlScript|Email")->Value;
$message=%1;
$selected=$sess->GetVar("selected_text","PerlScript|Email")->Value;
$mail_to=$mail_to_user . "@" . $mail_to_domain;

#DEBUG
$sess->EchoStr("Selected: " . $selected,15);
$sess->EchoStr("User: " . $mail_to_user,15);
$sess->EchoStr("Domain: " . $mail_to_domain,15);
$sess->EchoStr("Mailed to: . $mail_to,15);

my $status=Mail:SendEasy::send(
smtp=>'xxxx.xxxxx.xxxx',
user=>'xxxx.xxxx',
pass=>$password,
from=>'xxxx@xxxxx.com',
from_title=>'Charneus',
to=>$mail_to,
subject=>"screen text",
msg=>"$message",
);

if(!$status(
$sess->EchoStr("Error: " .Mail:SendEasy::error,15);
)
#Debug - message contents
#$sess->EchoStr($message,15);
#Debug end
#$sess->EchoStr("!!!! end !!!!",15);]]></value>
  </alias>
</cmud>


As you can see, it is set as an alias. I run 'syntax checker' and it's coming up with a lot of errors and is not working at all. For instance, $sess is returning not a valid local variable, despite it being set as PerlScript and shouldn't need it. Also, # Debug is returning 'Expected command.', which is telling me that it wants something like #SAY.

Anyone have any suggestions?

Charneus
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Mon Dec 15, 2008 3:30 pm   
 
Code:
<alias name="sendmail" copy="yes">

I don't see anything in this line saying this is perl code. I'd expect a 'language = perl' statement of some sort here. Have you actually set the language to be perl?
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Mon Dec 15, 2008 3:41 pm   
 
I have, but it's a known bug that may have not been fixed yet that languages do not copy over correctly. If it has been fixed, then I'm not sure what the problem is, as it is definitely PerlScript selected.

As a side note, changing everything to #SS "PerlScript" {blah blah blah} works...

Charneus
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Dec 15, 2008 5:52 pm   
 
The fact that the script language isn't shown in the XML is a known bug that is already on the bug list to be fixed soon. But if it is complaining about #debug then it definitely sounds like it's not executing this as a perl script. So maybe the bug is effecting more than just the XML code.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net