Sök
Hjälp?
Behöver ni experthjälp med något programmeringsärende eller vill ni kanske fråga om råd inför en IT-investering? Kontakta mig så ska jag försöka hjälpa er!Nyckelord
Addon Apache Computer CSS Design Development Download Error Firefox Google HOWTO HTML Internet Internet Explorer iPhone JavaScript JeOS Linux Microsoft MSDN MySQL NoScript Open Source Opera Patent Perl php Programmering Recension Roligt rsync Safari Security SEO Server Slow Software SSH Ubuntu Virus Visual Basic VMWare Web Windows Wordpress
Nyheter från New SeedAnnons
Arkiv
- November 2011
- October 2011
- September 2011
- August 2011
- July 2011
- June 2011
- May 2011
- April 2011
- March 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
- September 2010
- August 2010
- July 2010
- June 2010
- October 2009
- September 2009
- June 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
Tag Archives: Perl
Perl har hemlängtan
Även när jag skriver Perl-script i Windows börjar jag varje fil med:
#!/usr/bin/perl
Jag antar att jag har lite hemlängtan…
jQeury + Perl = sant
Perl-programmeraren i mig blir lycklig när den ser jQuery-kod som jag skapat nedan:
$("#dialog").dialog( "option", "buttons", { "Ok": function() { $("#"+id).val($('#dialog_selector').val());$(this).dialog("close"); } } );
Det är nästan så jag vill lämna den som den är, obegriplig och vacker, till nästa programmerare.
Best programming reference sites
On “Ask Slashdot” the readers recently got to answer which their favourite programming reference sites where for different languages. While most of the gems that where posted are quite well known I thought I’d make a quick summery of all the valuable links posted there.
Most languages have recieved at least one link but it’s interesting to see some obscure languages in there while others are not even listed (Visual Basic? educational languages like SmallTalk? and at the time of this writing no reference to either MSDN or Google Code). It’s a good group of links though, many informative pages here for anyone who uses these languages.
These are all the sites that programmers recommended (who else visits slashdot?) in alphabetical order.
Algol
http://www.algol68.org/
C
http://cprogramming.com/
http://www.acm.uiuc.edu/webmonkeys/book/c_guide/
http://www.devshed.com/
C++
http://www.cplusplus.com/
http://www.devshed.com/
http://www.parashift.com/c++-faq-lite/
http://www.sgi.com/tech/stl/
CSS
http://w3schools.com/css/default.asp
FORTH
http://www.phact.org/e/forth.htm
HTML
http://w3schools.com/html/default.asp
Java
http://java.sun.com/
http://java.sun.com/javase/reference/api.jsp
JavaScript
http://developer.mozilla.org/
http://w3schools.com/js/default.asp
Logo
http://el.media.mit.edu/Logo-foundation/logo/programming.html
LUA
http://lua-users.org/wiki/
http://www.lua.org/
http://www.lua.org/manual/5.1/
Lucid
http://www.haskell.org/haskellwiki/Lucid
Pascal
http://www.freepascal.org/docs-html/ref/ref.html
Perl
http://cpan.org/
http://use.perl.org/
http://www.perl.com/
http://www.perlmonks.org/
PHP
http://php.net/
PL/I
http://www.users.bigpond.com/robin_v/resource.htm
Prolog
http://www.logic.at/prolog/faq/faq.html
Ruby
http://ruby-doc.org/core/
http://api.rubyonrails.org/
Python
http://code.activestate.com/recipes/langs/python/
http://python.org/
Scheme (LISP)
http://srfi.schemers.org/
http://www.schemers.org/Documents/Standards/R5RS/
SNOBOL
http://www.snobol4.org/
TCL
http://en.wikibooks.org/wiki/Programming:Tcl
http://tcl.tk/
Multilanguage
http://c2.com/cgi-bin/wiki
http://www.gotapi.com/html
http://www.quickref.org/
http://www.regular-expressions.info/
http://www.rosettacode.org/wiki/Main_Page
Not purely programming but related
http://en.wikibooks.org/wiki/Main_Page
http://mindprod.com/jgloss/unmainprinciples.html
http://www.google.com/ (!)
Not mentioned links, added by me
Google Code
Visual Basic
SmallTalk
MSDN
Perl on Apache2 / Ubuntu 8.04.1 JeOS
Perl acctually works “out of the box” in Apache 2 installed on Ubuntu 8.04 JeOS. I found much confusion on this subject while browsing the Internet so I thought I’d post a simple HOWTO to get the first script running.
First you need a Ubuntu 8.04.1 JeOS server with a LAMP installation, see my previous guide on how to make one.
The first thing that can be confusing is where to find the right configuration files for Apache, while not needed for this guide I thought I’d post the current version for this guide here. A good overview of all distributions / versions can be found over at the Apaches wiki.
Debian, Ubuntu (Apache 2):
ServerRoot :: /etc/apache2
DocumentRoot :: /var/www
Apache Config Files :: /etc/apache2/apache2.conf
:: /etc/apache2/ports.conf
Default VHost Config :: /etc/apache2/sites-available/default, /etc/apache2/sites-enabled/000-default
Module Locations :: /etc/apache2/mods-available, /etc/apache2/mods-enabled
ErrorLog :: /var/log/apache2/error.log
AccessLog :: /var/log/apache2/access.log
cgi-bin :: /usr/lib/cgi-bin
binaries (apachectl) :: /usr/sbin
start/stop :: /etc/init.d/apache2 (start|stop|restart|reload|force-reload|start-htcacheclean|stop-htcacheclean)
Now as I said, Perl is allready working so we just have to find it in our system! As since in the chart above the cgi-bin is located in /usr/lib/cgi-bin. Here we want to put a Perl Hello World script.
sudo nano /usr/lib/cgi-bin/test.pl
In the script I type the following very standard Hello World script:
#!/usr/bin/perl -w
print “Content-type: text/plain\n\nHello World!\n”
We need to make it executable so we chmod it:
sudo chmod 755 /usr/lib/cgi-bin/test.pl
To make sure it’s working a good tip is to try it at the command line first to check for any spelling errors (especially in the header, errors there will lead to a 500 internal server error response).
perl /usr/lib/cgi-bin/test.pl
If it runs and returns the content-type line, two new lines and a hello world then we’re set! Browse to the IP of the server, in my case it’s 192.168.0.16 so I enter:
http://192.168.0.16/cgi-bin/test.pl
Hello World!