Link to home
Start Free TrialLog in
Avatar of srinims
srinims

asked on

Call Perl script function from html or vbscript

unable to call perl script from html or from vbscript

<SCRIPT LANGUAGE="PerlScript">
sub FindEffort()
{
  ..
  ..
}
</SCRIPT>
<SCRIPT LANGUAGE="VBScript">
sub Effort
 FindEffort()      
end sub
</SCRIPT>

<FORM action="" Name="Effort" >
<input type="button" value="CHANGE" onClick=FindEffort>
</FORM>


in both the places it's giving type missmatch findeffort. what i can do to rectify this.
Avatar of enachemc
enachemc
Flag of Afghanistan image

you will never be able to do that. Client side script cannot call a server side function. It can only call a page. The way to do what you want is to call your function through AJAX. Just give it a search - the web is full of ajax.
Avatar of clockwatcher
clockwatcher

The following works for me:

<html>
<head>
<script language="perlscript">

      sub perlthis {
            my $arg = shift;
            alert($arg);
      }

</script>

<script language="vbscript">

      function testcall
            perlthis("hello")
      end function
      
</script>
</head>
<body>
      <form>
            <input type="button" onclick="vbscript:testcall()" value="click">
      </form>
</body>
</html>

You are running this from the local (My Computer) zone and allowed active content when prompted?  Perlscript is disabled for anything outside of the local zone.   If you want to change that-- and if this computer is connected to the internet you shouldn't-- but if you want to see:

http://aspn.activestate.com/ASPN/docs/ActivePerl/5.8/Components/Windows/PerlScript.html#perlscript_configuration
ASKER CERTIFIED SOLUTION
Avatar of clockwatcher
clockwatcher

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
<SCRIPT LANGUAGE="PerlScript">

does your browser support perl this way?
If it supports vbscript odds are going to be pretty good that it supports perlscript.  Don't think anyone has bothered to include a vbscript interpreter in a browser for a non-MS platform-- I think they'd be afraid of being laughed at by friends.  And if you're on a MS platform you'd provide support for vbscript through the IActiveScript COM interface (unless you have way way way too much time on your hand) rather than roll your own version-- so perlscript ought to run with it too.
Avatar of srinims

ASKER


the actual problem was the activex script engine for perl is not installed.

in on default activex script engine for javascript and vbscript would be there in the windows. to avail perl script we need to instal activex scripting engine.