JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 19th, 2000, 10:23 AM
Crios Crios is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2000
Location: Phoenix, AZ
Posts: 3 Crios User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Is there a way to call perl functions from javascript functions?

I'd prefer to do this in a way other than doing posts or gets.

Any help would be appreciated.

Here's my so-so example. Does this help explain my problem?

calling method => SaveData(this.form);
// in the form i've declared a bunch of
// inputs name=accesslist[] value=1..
function SaveData (f) {
// perl function to save array to file
savearray(f.accesslist[]);
}

# perl function
sub savearray {
my (@arraytosave) = (@_);
$FILEOUT = '>tmp.txt';
open(OUT, $FILEOUT) die "Can't open file";
foreach $arrayelem (@arraytosave) {
print OUT "$arrayelemn";
}
close OUT;
}


[This message has been edited by Crios (edited September 19, 2000).]

Reply With Quote
  #2  
Old September 19th, 2000, 11:56 AM
tron's Avatar
tron tron is offline
SwollenMember
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Location: the master control
Posts: 264 tron User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 14 m 57 sec
Reputation Power: 13
yes...i think i understand what you are asking and it can be done...could you give a specific example of what you are trying to achive?

Reply With Quote
  #3  
Old September 20th, 2000, 08:19 AM
JSchoof JSchoof is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Posts: 82 JSchoof User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 23 m 46 sec
Reputation Power: 13
Uh, I am pretty sure you are not going to be able to do this. JavaScript is a client side language, where as Perl is most likely going to be on your server side.

It would probably be easier for you to use a JS redirect to bounce off a perl script.

[This message has been edited by JSchoof (edited September 20, 2000).]

Reply With Quote
  #4  
Old September 21st, 2000, 02:13 AM
MeijdenB MeijdenB is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Location: Alkmaar, The Netherlands
Posts: 123 MeijdenB User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 14
Actually I thought it wasn't possible untill ysetderday. Someone accidentally showed me how to do it.

- Make a perl-script that outputs Javascript.
- Put this in your cgi-bin directory.

- Call this script like <SCRIPT LANGUAGE="Javascript" SRC="cgi-bin/yourscript.pl"></SCRIPT>

- Use the variables that are made declared by the perl-script in your next script tag.

------------------
Good luck,
Bas

------------------
E-mail me at: b.vandermeijden@pecoma.nl

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Calling perl from javascript

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap