PHP tutorial for a perl programmer

Zbigniew Koziol softquake-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Fri Nov 10 00:56:35 UTC 2006


On Thursday 09 November 2006 19:21, Madison Kelly wrote:
>
>    Has anyone seen a php tutorial that would be particularly suited to
> someone who has a perl background? Rather than "this is what an if/else
> loop is" one that has more "in perl, you would do this whereas now in
> php you'd do that...". Thank kind of thing.

Go to www.php.net and get there to documentation. Or better download it and 
unpack it on your localhost. Have a glimpse there, or two glimpses ;) PHP is 
very easy to grasp. After that you will notice how easy you can start using 
PHP. Your first PHP script (assuming that you have a php-enabled server 
running. will look like this:

<? phpinfo(); ?>

or

<? echo "hi there"; ?>

After that, study various functions available, especially if there are things 
there that might be familiar to you.

I am not an eagle in anyone of them. At the level I can notice, there are some 
differences in handling regular expressions. Somewhat differently arrays are 
treated. PHP is less abstract also. Takes less care of the scope of 
variables, or, rather, takes care in a different way. But most of things that 
can be done in perl can also be done in php, in a quite similar way. At least 
at lower levels of programming. I am used to translate between them. Both of 
them have their own ways of connecting with databases and making queries but 
still things remain similar. 

A difference is in that also that perl uses external modules installed by CPAN 
while PHP uses PEAR (but PEAR does not exist for long and is not so reach as 
CPAN repositories). 

Also, in case of PHP many things need to be precompiled into php module that 
is loaded by apache (let say), (which is usually very easy) while in case of 
perl we are used to install CPAN modules.

>    Failing that, a php tutorial aimed at people who have a programming
> background of any sort would be great, too.

I do not know that sort of tutorial and do not much care to know :)

zb.


> Thanks all!
>
> Madi - who is keen to earn extra holiday moneys :3
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list