473,795 Members | 3,457 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Discrimination of Forth versus perl

I am trying to do some web scripting in Forth
This is a transcript of the perl
example from O'Reilly (Gundavaram) CGI-programming pg. 17.

With the multiple line strings and the occasional
auxiliary word, it looks neater than perl IMO.

However, no environment variables can be accessed from the
script apparently. The corresponding perl script has no
such problems. (Environment available in an associative
array %ENV ).
What is going on here?

[For those unacqainted with CGI, these are scripts that
generates html "on the file". With variable content.]
---------8<----------------8<--------------
#!/usr/bin/lina -s

\ Using server site scripting in Forth.

\ ---------- requisites -----------------
REQUIRE GET-ENV
\ Print environment variable from its NAME.
: .ENV GET-ENV TYPE "<BR>" TYPE CR ;

\ --------- push the scripts prelude --------------
"Content-type: text/html

<HTML>
<HEAD><TITLE> About this server</TITLE></HEAD>
<BODY>
<H1>About this server</H1>
<HR>Welcome to Albert's brave new world of Forth scripting!<HR>
<PRE>
" TYPE

\ --------- push information ---------------------
"Server Name: " TYPE "SERVER_NAM E" .ENV
"Running on port: " TYPE "SERVER_POR T" .ENV
"Server SOFTWARE: " TYPE "SERVER_SOFTWAR E" .ENV
"Server PROTOCOL: " TYPE "SERVER_PROTOCO L" .ENV
"CGI Revision: " TYPE "GATEWAY_INTERF ACE" .ENV
"Server Name: " TYPE "SERVER_NAM E" .ENV
"PATH Name: " TYPE "PATH" .ENV

\ --------- push the scripts postlude --------------
"</PRE>
</BODY>
</HTML>
" TYPE
---------8<----------------8<--------------
--
--
Albert van der Horst,Oranjestr 8,3511 RA UTRECHT,THE NETHERLANDS
Economic growth -- like all pyramid schemes -- ultimately falters.
al****@spenarnc .xs4all.nl http://home.hccnet.nl/a.w.m.van.der.horst
Jul 19 '05 #1
1 2936
In article <if********@spe narnc.xs4all.nl >,
Albert van der Horst <al****@spenarn c.xs4all.nl> wrote:
I am trying to do some web scripting in Forth
This is a transcript of the perl
example from O'Reilly (Gundavaram) CGI-programming pg. 17.

With the multiple line strings and the occasional
auxiliary word, it looks neater than perl IMO.

However, no environment variables can be accessed from the
script apparently. The corresponding perl script has no
such problems. (Environment available in an associative
array %ENV ).
What is going on here?


I goofed. Apparently the implementation of ENV is broken.

With a redefinition of ENV (a ciforth specific dirty
hot patch) the script works:

\ Mysterious hot patch of ENV
: ENV' OLD: ENV 2 CELLS + ;
'ENV' 'ENV 3 CELLS MOVE

No discrimination agains Forth here.

<Script SNIPPED, see previous post>

Groetjes Albert

--
--
Albert van der Horst,Oranjestr 8,3511 RA UTRECHT,THE NETHERLANDS
Economic growth -- like all pyramid schemes -- ultimately falters.
al****@spenarnc .xs4all.nl http://home.hccnet.nl/a.w.m.van.der.horst
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2226
by: DesignGuy | last post by:
I've read comparison of Perl vs. PHP regarding features and coding, however I would like to know how each affects server load. I am looking at two scripts - one in Perl and the other in PHP - for the Amazon Product Feed. My understand is that Perl must be compiled on each execution and that PHP does not, therefore PHP is less of a load on the server. Comments, anyone?
4
2432
by: Preslopsky | last post by:
I am currently evaluating what language I should use to create a web interface to some of our databases. I am purely in the fact finding stage at this point, having no website nor database set up yet. This is sort of a new area for me, so I am looking for some advice. Part of our organization has Cold Fusion running on its web server. It would really be no problem for me to build an application there for some of the "public" verisions...
31
4811
by: surfunbear | last post by:
I've read some posts on Perl versus Python and studied a bit of my Python book. I'm a software engineer, familiar with C++ objected oriented development, but have been using Perl because it is great for pattern matching, text processing, and automated testing. Our company is really fixated on risk managnemt and the only way I can do enough testing without working overtime (which some people have ended up doing) is by automating my...
15
2589
by: David Quinton | last post by:
<http://www.business2www.com/news.html?id=1217547344> Precis: "The Disability Discrimination Act (DDA) requires businesses and organisations to make websites accessible to all users, particularly the disabled. Yet the DRC, the Royal National Institute for the Blind (RNIB) and the Royal National Institute for the Deaf (RNID), the supposed standard bearers for website accessibility, continue to fail even the most basic A/AA requirements....
2
2534
by: Lisa Pearlson | last post by:
Hi, My php application (on Apache/Linux) needs to do the following: The PHP script receives a request from a client (binary), asking for certain records of data. My PHP script loops through all records and sends each of them ONE BY ONE. After each record that my server script sends, it waits for the client to confirm proper reception with an ACK (binary digit). When there are no more records, my server script sends the client a binary
9
4527
by: Dieter Vanderelst | last post by:
Dear all, I'm currently comparing Python versus Perl to use in a project that involved a lot of text processing. I'm trying to determine what the most efficient language would be for our purposes. I have to admit that, although I'm very familiar with Python, I'm complete Perl noob (and I hope to stay one) which is reflected in my questions. I know that the web offers a lot of resources on Python/Perl differences. But I couldn't find a...
135
7532
by: Xah Lee | last post by:
Tabs versus Spaces in Source Code Xah Lee, 2006-05-13 In coding a computer program, there's often the choices of tabs or spaces for code indentation. There is a large amount of confusion about which is better. It has become what's known as “religious war” — a heated fight over trivia. In this essay, i like to explain what is the situation behind it, and which is proper.
42
5466
by: John Doty | last post by:
I realized that I have a little job on the table that is a fine test of the Python versus Standard Forth code availability and reusability issue. Note that I have little experience with either Python or Standard Forth (but I have much experience with a very nonstandard Forth). I've noodled around a bit with both gforth and Python, but I've never done a serious application in either. In my heart, I'm more of a Forth fan: Python is a bit...
6
3014
by: surfivor | last post by:
I may be involved in a data migration project involving databases and creating XML feeds. Our site is PHP based, so I imagine the team might suggest PHP, but I had a look at the PHP documentation for one of the Pear modules for creating XML and it didn't look like much. I've used Perl XML:Twig and I have the impression that there is more Perl stuff available as well as the Perl stuff being well documented as I have a Perl DBI book, a Perl...
0
9672
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9519
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10437
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10164
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10001
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6780
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5437
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.