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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mabye this will wet your appetite for clientside perl

Status
Not open for further replies.

Phalanx1

Programmer
Jul 21, 2003
128
US
<body id=&quot;Bel&quot;>
<div id=&quot;Response&quot;></div>
<h2>Test of PerlScript</h2>
<p>
<textarea id=&quot;htmlstr&quot; rows=&quot;15&quot; cols=&quot;25&quot;></textarea>
<br><input type=&quot;button&quot; onclick=&quot;wrhta&quot; value=&quot;Write to html file&quot;>
<br><input type=&quot;button&quot; onclick=&quot;apphta&quot; value=&quot;append to html file&quot;>
</p>

<script language=&quot;PerlScript&quot;>
sub sayHello {
# This function takes two parameters, creates a string
# from the parameters, and returns the string.

# get the two parameters into local variables
my ($strName, $strTime) = @_;
#now, create the return string.
$strRetVal=&quot;Hello $strName. The time is $strTime.&quot;;

# Return the string
$strRetVal;
}
use FileHandle;
sub wrhta {
$fh = new FileHandle &quot;>> Begin.htm&quot;;
if (defined $fh) {
my $HTMLstr = $window->document->getElementById(&quot;htmlstr&quot;)->innerText;
print($fh &quot;$HTMLstr\n&quot;);
$fh->close;
}
}
sub apphta {
$fh = new FileHandle &quot;Begin.htm&quot;, O_WRONLY|O_APPEND;
if (defined $fh) {
my $HTMLstr = $window->document->getElementById(&quot;htmlstr&quot;)->innerText;
print($fh &quot;$HTMLstr\n&quot;);
undef $fh; # automatically closes the file
}
}

</script>
</body>
this is an interpolation of my web page own ability to write html to it self but this writes your html to another file, if you cant tell.
 
To be honest it doesn't really wet my appeptite ... your code cannot be guaranteed portable ... infact I'd go as far as to say your code is not portable - period. The more application dependent bolt-ons you put on the 'client-side' the less portable your code becomes ...

I really don't understand where you are coming from here? I think we all understand that perl can be installed and manipulated locally however what are you really gaining by doing this in a true that the already established javascript or vbs cannot do? the web is a client -server environment not a whole series of independent clients running their own applications ... client side perl will not and cannot replace the client - server approach.

To me your persistent debate on this subject is pointless.
 
Yea what perlnewb says.

Most of the people here are not to worried about 'can you do it' and more concerned with 'why should you do it'.

Your code will never run outside your limited world. Which is fine but most of us are concerned with broader audiences.

 
Hello again,
Yeah the Broader audience = The World
The World Sadly uses Windows
Windows Sadly uses IE
Microsoft Sponsered(i.e. gave money to ActiveState To Make Perl Portable to Windows 32/64.
32(past)64(future) bit is Future/past of Windows
Perl is Future for Windows...
and me recognizing this i want to be at the future now learning it's quarks now! not then, Now! do you understand... i am new at it but i refuse to give up even under fire from anyone. the only thing I want to do is push the envelope as much as I can you know put my 2 cents into it [morning], experiment, try succeed fail it matters not try again and again, B-) it does not matter to me. all am am doing is try to look for somethat is under the same circumstances as me and willing to help and be helped in return.

Sorry Bout the Rant
Sincerly Ryan April NetAdmin\Programmer
if you have any comment you want to write to me
Mail me at Rksmw@Aol.com
our at rapril@Mcintoshstudent.com
please no rudeness. thank you.
 
If you are trying to learn the future of windows you are wasting your time with perl. PerlScript is being deprecated at every level of the MSDN process.

Additionally, even thinking that MS will promote 'perl' over Visual Basic is insanely delusional. Every aspect of windows scripting is VBScript centric, many methods are not even available in Jscript or PerlScript and never will be(according to developers resouces). Perl is not a priority for them and is more of an after thought and a hack.

Even their funding of ActiveState was done for ANTITRUST purposes, not technology transfer or true return on investment. Supporting Non-MS centric technologies gets them a lot of credit with the Anti-Trust lawyers in the US Government. This investment is commonly viewed within the development community as a red herring.

Perl does not ship with windows, your code is irrelevant outside your install base and always will be. What is it about forcing someone to download an 11 meg installer to use your webpage do you see as 'standard'? Longhorn (next version of windows) will not contain Perl nor does XP. Perl inclusion in the standard install is not on the MS roadmap.

Lecturing us on the realities of the computer industry is pretty stupid, we are all veterans of the OS wars here.

No one is telling you not to do it but don't expect anyone to really appreciate it all that much.
 
Even if the world did say 'the heck with it I am installing perl'... how would you achieve a standard installation process, the correct directory structure, assurance of the correct associations, module loads, and so on...



[Blue]Blue[/Blue] [Dragon]

If I wasn't Blue, I would just be a Dragon...
 
I don't expect to be appreciated, just respected, and mabye helped.

thank you for your respect\help\comments siberian
 
We are here to help but so far you are not asking questions, just engaging in a debate about how PerlSCript is taking over the world ;)

I'm looking forward to helping you and seeing what you can do with it but I will also say publically what i think of your assertations because OTHER new programmers read these threads and may embark on , what I consider, to be an unwise course.

Now, my opinion doesn't count for much but all I can do is express it :)

So please, continue to ask questions and we will continue to help as best we can. But you are breaking territory that not many of us have seen before so we won't always have the answers you need, you'll be teaching us!

 
a batch file setup and a plx with a lot of use statments...
 
This may be a good topic for the:

Where is IT Going In The Next 5 Years forum :)



[Blue]Blue[/Blue] [Dragon]

If I wasn't Blue, I would just be a Dragon...
 
that was a funny post siberian, now i see where you are coming from, and understand what you mean.

so lets end this debate and get on with the PerlScript 'Teaching'

my first idea in full
first a server Side HTA that makes the Server Sockets
with the names Build Customer EmpBoard
each socket writes html line by line to the socket upon connection to it.upon close of the socket the client reads socket stdin to a hidden Text area that is conteneditable upon the client use Document.insertAdjacentHTML(SockHTMLRet.innerText);
to build the required application dynamically. or document.write(SockHTMLRet.innerText)

i extremly enjouy learning from people as fluent in perl as yourself. your opinion does matter, to me at least.

 
What is Where is IT Going In The Next 5 Years forum
besides the obviouse meaning behind the name and are they able to help with clientside perl
 
Hmm, if you are already writing server side apps do you need PerlScript on the client? What does perlscript on the client get you that you couldnt just do on the server side?

 
creation of the Client Connect to Socket on server.

i also use vbscript jscript and javascript xml and others for clientside but perlscript do it does it quicker and with less overall clientside code which = less bandwidth use which = more network reources for doing other tasks.
it is all about time and money, in my opinion, and PerlScript is ClientSide is much bless much shift extremly more powerful than any scripting languages i have come accross... as the example above demonstrates, kind of.
its like notepad but kind of better because it is an active interface and can save any kind of file except database files because it isn't built to fill in separate fields of a database.

 
Hmm, yea, let us know how that goes. Having done more systems like this then I can count I can say that you are not really saving much on the network or time or money. In fact, you will spend a lot more time and money trying to get the bugs out of a hand-rolled system then you are saving anywhere else.

If it were me I'd just let the browser connect to a web-page that was generated by a server side application that did all my logic rather then embedding any logic in the web-page. Thats me, I am all about 'use what works and only invent if you have to'.

Let us know how it goes. I think your approach is overly complex and flawed but you seem convinced, I will be interested in seeing it evolve. Send us a link when its available.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top