function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
GregoryGregory 

Simple Client-Side Perl Script in S-control

I'm trying to put a simple client-side Perl sript into an S-control. I'm trying:

Code:
<html> <body>
<script language="PerlScript">
$window->document->write("Hello Perl world!");
</script>
This is straight HTML.
</body> </html>

The HTML text displays fine, but the Perl script doesn't get executed to execute. I have Perl installed on my local PC and IE renders the same above HTML correclty executing the PERL script. Is it possible to run client-side Perl in Salesforce?   Or is there setting I need in IE that is different between a SalesForce page and rendering a local html page?

Thanks,
Gregory

sfdcfoxsfdcfox
PerlScript... I'll need to look into that. It sounds like a dream come true. However, that being said, if the code isn't running, I'd bet on an installation or configuration issue, since it should work automatically without a problem. I'd recommend using JavaScript unless that's impossible, since all browsers understand that without any additional plugins.
 
~ sfdcfox ~
GregoryGregory

sfdcfox,

Thanks for your response.   Perhaps the problem is related to cross-domain scrippitng being not allowed in IE?   However, seems like JavaScript and Perl are both acting like client-side scripts so they both should work.

The reason I want to used PERL is that I need to do a bunch of text manipulation and PERL is signifcantly more powerful than JavaScript for this kind of exercise.

Please let me know if you figure anything.

sfdcfoxsfdcfox
Regular Expressions are supported in JavaScript as well as Perl, and should be a trivial conversion, since the standards groups responsible for this functionality tried to make it as compatible as possible without breaking ECMA standards for JavaScript. For example:

Perl:
$mystring =~ m/[\w]{3}/; # find a three letter word.

JavaScript:
match = mystring.match(/[\w]{3}/) // find a three letter word.

See? Just a little bit different syntax, but the actual RegExp parameter is the same in both cases. Just remember that you should use "JavaScript1.2" or higher as your language parameter. This will make a portable version that doesn't depend on external libraries or plugins in order to make it work. For additional information, try a google search on the subject.

~ sfdcfox ~
GregoryGregory
<SCRIPT type=text/javascript></SCRIPT> <SCRIPT src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type=text/javascript> </SCRIPT>
Thanks so much for the advice on regular expressions in JavaScript.   I initially could see doing what I need in Perl, but if possible in JavaScript that would be better.
 
That being said, can you help me with writing some client-side Javascript (for page 1) that will request a new URL (page 2), parse the resulting HTML, find a set of email addresses embedded in an HTML table, and then finally call a another page (page 3) passing as query strings the emails found on page 2.

I know how to do a window.open("URL"), but how to actually have the javascript get the resulting HTML as a long string, and then parse it looking for email addresses?

Thanks for any help/advice you can provide.

Gregory
sfdcfoxsfdcfox
I'll write some generic code when I get home, but if you want, you can PM me precise details of what you're trying to do (eg. What parameters need to be passed? How is the HTML formatted? Is authorization required?). This type of information, while not criticial, would allow me to write code that's tailored to your requirements instead of including all manners of generic functions. I've got another project I've got to do tonight, too...

~ sfdcfox ~