Training, Open Source computer languages

PerlPythonMySQLTclRubyC & C++LuaJavaTomcatPHPhttpdLinux

Search our site for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
What language is this written in?

It's been a long day ... I'm not sure whether to write about my drive back from Gatwick Airport this morning through the beautiful National Trust Woods at Holmwood, Abinger Hammer with its curious clock that hangs over the road, the Hog's Back where I stopped for a bacon buttie ... then on past Stonehenge and over Salisbury Plain.

No - you KNOW the beauty of this country already. I'll write about a piece of coding that I've just completed. Can you work our the language??

if (\$dirin == "$page{dir}" and \$parts[0] == "$page{key}.html") {
for (\$k=1; \$k<count(\$parts); \$k++) {
\$state = implode(" ",explode("-",\$parts[0]));
\$state = preg_replace('/\\.html/','',\$state);
\$forumlinks .= "<a href='/resources/\$parts[\$k].html'>Link to technical articles</a><br>";
break; # first only
}
}

Yes, we'll teach you all the subjects involved.

Answer tomorrow

.... Oops .... it's the day AFTER tomorrow ... I'll answer in a comment so that other folks can "play" the question without having the answer thrust in their face first ...
(written 2005-05-17 18:54:07)

Commentatorsays ...
Graham:Answer ....

This code is written in PHP embedded in a Perl HERE document. I had better explain.

Our Opentalk Forum provides a question and answer "stage" which past trainees and others can use to resolove issues that - although they look obvious - aren't easy to get resolved.

Answers build up on Opentalk, and we want to archive them and sort them so that they're useful for other people later on. We do this through a Perl script which runs as a regular job (crontab) and generates a page for each thread, each with its own appropriate URL. It's a part of that Perl script that I quoted on "The Horse's Mouth".

As the archive has grown, it's been desirable to have each of the archive pages placed into a category ... so that the user of the archive can look around for other similar questions and other resources too. So ... that archive pages aren't flat, but rather they're PHP ... thus the need to have a Perl program that generates a PHP script, and that's part of what you saw quoted.

So - in my example code:

\$ is a PHP variable that's used when the page is viewed
but
$ (without a \) is a Perl variable that's used when the crontab job is run.

And, no, this isn't easy code to debug!



(comment added 2005-05-19 10:32:36)
Associated topics are indexed under
P604 - Using Perl for Web Site Management
H112 - PHP - Further Web Page and Network Handling
G902 - Well House Consultants - Web site techniques, utility and visibility

Back to
Making bona fide international marriages more difficult
Previous and next
or
Horse's mouth home
Forward to
Supporting local business
Some other Articles
Choosing a theme
Programming languages - a comparison
Development Environments
Supporting local business
What language is this written in?
Making bona fide international marriages more difficult
Maud Heath
Growth pains
Just in time - the talk is writ
Writing a Tcl/Tk GUI is as easy as baking a cake
1892 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 at 50 posts per page


This is a page archived from The Horse's Mouth at http://www.wellho.net/horse/ - the diary and writings of Graham Ellis. Every attempt was made to provide current information at the time the page was written, but things do move forward in our business - new software releases, price changes, new techniques. Please check back via our main site for current courses, prices, versions, etc - any mention of a price in "The Horse's Mouth" cannot be taken as an offer to supply at that price.

Link to Ezine home page (for reading).
Link to Blogging home page (to add comments).

© WELL HOUSE CONSULTANTS LTD., 2008: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 0800 043 8225 or 01225 708225 • FAX: 0845 8382 405 or 01225 707126 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho