473,750 Members | 2,265 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

php and perl

Hi,

this is not stinky bait. If you take it that way, please dont respond..

I have been away from UNIX software for quite awhile and want to get
back into it. I liked "C" but Java seems like the way to go for
compiled langs, now days so I will learn that.

At one time, I did a bit of perl but now I see php alot. I was
wondering what you guys thinks of the pros/cons of perl and php.

I appreciate your time,
peter
Jun 12 '07 #1
9 1787
peter wrote:
Hi,

this is not stinky bait. If you take it that way, please dont respond..

I have been away from UNIX software for quite awhile and want to get
back into it. I liked "C" but Java seems like the way to go for
compiled langs, now days so I will learn that.

At one time, I did a bit of perl but now I see php alot. I was
wondering what you guys thinks of the pros/cons of perl and php.

I appreciate your time,
peter
Peter,

They're both good languages. Each has its advantages and disadvantages,
of course. And both are in more widespread use than Java, IMHO.

I've learned all three. I use PHP the most; Perl next and Java the least.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Jun 12 '07 #2
Jerry Stuckle wrote:
>
Peter,

They're both good languages. Each has its advantages and disadvantages,
of course. And both are in more widespread use than Java, IMHO.

I've learned all three. I use PHP the most; Perl next and Java the least.
care to discuss your thoughts on adv/disadv?
thanks
Jun 12 '07 #3
On Jun 12, 1:31 pm, peter <p...@juno.comw rote:
Jerry Stuckle wrote:
Peter,
They're both good languages. Each has its advantages and disadvantages,
of course. And both are in more widespread use than Java, IMHO.
I've learned all three. I use PHP the most; Perl next and Java the least.

care to discuss your thoughts on adv/disadv?
thanks
I noticed you asked again for pro/con breakdowns and such. I'm not
much of a resource--you'll see that others are much more reliable on
this group--but I thought I'd share my experience just the same.

I've learned all three at one point or another, but I haven't
developed in Java for a few years now. I don't really like Perl in
general; I feel like PHP does everything I would need Perl to do and
does it with cleaner code syntax and structure. As a result, I never
really used Perl in anything large scale or with a significant scope.

At the time when I used all three, I found PHP to be the easiest to
read and write visually, and also one of the easiest to learn--I think
the syntax and structure made sense and I typically described it to
people unfamiliar with it as a programmer's language (this was after
using C++ and Java in school and learning Perl). That being said, I
think that PHP's OOP support at the time (this was a few years ago)
was nonexistant, and only with PHP5 has it really gotten to the point
where I'd use it in production code. Java is much more strictly OOP
and was very useful for compiled console applications, and I enjoyed
using it for that purpose.

Now, of the three, I use only PHP, developing applications online part
time and as a hobbyist. If I wanted to develop a GUI based console
application, I would probably rather figure out the PHP GTK than go
back to Java, but that is more because PHP is so comfortable for me
now.

So, to summarize:
PHP:
-pros: easy to read, easy to learn, intuitive syntax, good for web
development
-cons: new OOP support, relatively dynamic structure (you will see on
here people talking about how functions or behaviors change between
point versions)

Java:
-pros: strong OOP, good documentation (that I recall), good for
console applications & GUIs
-cons: harder to learn, takes longer to become comfortable, I think;
pretty strictly OOP

Perl:
-pros: great cult like following ;-)
-cons: somewhat unintuitive, obsolete compared to PHP (IMHO)

That's my opinion, anyway.

Jun 12 '07 #4
peter wrote:
Jerry Stuckle wrote:
>>
Peter,

They're both good languages. Each has its advantages and
disadvantage s, of course. And both are in more widespread use than
Java, IMHO.

I've learned all three. I use PHP the most; Perl next and Java the
least.

care to discuss your thoughts on adv/disadv?
thanks

BJ has made some comments - although I don't necessarily agree Perl is
obsolete. There are a lot more packages out there for Perl than PHP,
IMHO. And they're much easier to install. But I pretty much agree with
the rest. I did find Perl hard to understand until I really got into
it. PHP, OTOH, was pretty natural - probably because of years of C++
experience.

Perl is also a lot more stable. No major changes between releases, like
is occurring in PHP. I haven't had much trouble with PHP code breaking
from one release to the next, but that's more because I'm careful in
what features I use. But it still does occasionally. And I suspect
when Release 6 comes out I will have to make some changes.

Java is also pretty stable. Although new features are being added,
there isn't much which breaks the code. But I've found it to be much
more CPU-intensive than PHP or Perl. There are also many fewer hosts
who support Java (one of the main reasons I got into PHP and Perl).

Basically I pick a language depending on the job to be done. Most of
the time it's PHP. But as I said before - I use the others, also.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Jun 12 '07 #5
peter wrote:
Hi,

this is not stinky bait. If you take it that way, please dont respond..

I have been away from UNIX software for quite awhile and want to get
back into it. I liked "C" but Java seems like the way to go for
compiled langs, now days so I will learn that.

At one time, I did a bit of perl but now I see php alot. I was
wondering what you guys thinks of the pros/cons of perl and php.

I appreciate your time,
peter
thanks guys. it was useful. Being from a UNIX background, I found perl
intuitive :) if php is c++ like, I dont think I would care for it. I
shall see if others contribute more later.

i appreciate your comments.
peter
Jun 12 '07 #6
On 12.06.2007 13:19 peter wrote:
Hi,

this is not stinky bait. If you take it that way, please dont respond..

I have been away from UNIX software for quite awhile and want to get
back into it. I liked "C" but Java seems like the way to go for
compiled langs, now days so I will learn that.

At one time, I did a bit of perl but now I see php alot. I was
wondering what you guys thinks of the pros/cons of perl and php.

I appreciate your time,
peter

perl and php are both outdated, cumbersome and ugly. You’d be better off
learning python or ruby, IMHO.

--
gosha bine

extended php parser ~ http://code.google.com/p/pihipi
blok ~ http://www.tagarga.com/blok
Jun 13 '07 #7
peter wrote:
thanks guys. it was useful. Being from a UNIX background, I found perl
intuitive :) if php is c++ like, I dont think I would care for it. I
shall see if others contribute more later.
I would say that PHP is more Perl-like than C++-like. I started PHP with a
background in Perl and found it very easy to pick up.

Here's an example to demonstrate their similarities.

Perl:

#!/usr/bin/perl

$a = 1;
$b = 1;
$c = undef;
$psi_old = undef;

print "Approximat ing psi...\n";
while (1)
{
$psi = sprintf('%.08f' , $b/$a);
last if ($psi_old eq $psi);
$psi_old = $psi;
print "$psi\n";

$c = $a + $b;
$a = $b;
$b = $c;
}

PHP:

<?php

$a = 1;
$b = 1;
$c = NULL;
$psi_old = NULL;

print "Approximat ing psi...\n";
while (1)
{
$psi = sprintf('%.08f' , $b/$a);
if ($psi_old == $psi) break;
$psi_old = $psi;
print "$psi\n";

$c = $a + $b;
$a = $b;
$b = $c;
}

?>

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 109 days, 15:48.]

URLs in demiblog
http://tobyinkster.co.uk/blog/2007/05/31/demiblog-urls/
Jun 13 '07 #8
>peter


perl and php are both outdated, cumbersome and ugly. You’d be better off
learning python or ruby, IMHO.
hmmm more to consider, thanks
Jun 13 '07 #9
Toby A Inkster wrote:
peter wrote:
>thanks guys. it was useful. Being from a UNIX background, I found perl
intuitive :) if php is c++ like, I dont think I would care for it. I
shall see if others contribute more later.

I would say that PHP is more Perl-like than C++-like. I started PHP with a
background in Perl and found it very easy to pick up.

Here's an example to demonstrate their similarities.

Perl:

#!/usr/bin/perl

$a = 1;
$b = 1;
$c = undef;
$psi_old = undef;

print "Approximat ing psi...\n";
while (1)
{
$psi = sprintf('%.08f' , $b/$a);
last if ($psi_old eq $psi);
$psi_old = $psi;
print "$psi\n";

$c = $a + $b;
$a = $b;
$b = $c;
}

PHP:

<?php

$a = 1;
$b = 1;
$c = NULL;
$psi_old = NULL;

print "Approximat ing psi...\n";
while (1)
{
$psi = sprintf('%.08f' , $b/$a);
if ($psi_old == $psi) break;
$psi_old = $psi;
print "$psi\n";

$c = $a + $b;
$a = $b;
$b = $c;
}

?>
C/C++:

#include <stdio.h>
float a = 1.0;
float b = 1.0;
float c = 0.0;
float psi_old = 0.0;

puts ("Approximat ing psi...");
while (1) {
psi = b/a;
if (psi_old == psi)
break;
psi_old = psi;
printf ("%f\n", psi);
c = a + b;
a = b;
b = c;
}

Of course, C++ has many OO features the C doesn't have.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Jun 13 '07 #10

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

Similar topics

4
8134
by: Mark Wilson CPU | last post by:
This must be easy, but I'm missing something... I want to execute a Perl script, and capture ALL its output into a PHP variable. Here are my 2 files: ------------------------------------- test3.pl ------------------------------------- print "PERL Hello from Perl! (plain print)<br>\n"; print STDERR "PERL This is text sent to STDERR<br>\n"; $output="PERL Some output:<br>\n"; for ($i=0; $i<5; $i++) {
31
4801
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...
0
9744
by: Kirt Loki Dankmyer | last post by:
So, I download the latest "stable" tar for perl (5.8.7) and try to compile it on the Solaris 8 (SPARC) box that I administrate. I try all sorts of different switches, but I can't get it to compile. I need it to be compiled with threads. Anyone have any wisdom on how best to do this? Here's a transcript of my latest attempt. It's long; you might want to skip to the bottom, where I try "make" and the fatal errors start happening.
13
3262
by: Otto J. Makela | last post by:
I'm trying to install to php the Perl-1.0.0.tgz package (from http://pecl.php.net/package/perl, enabling one to call perl libraries) to a pre-existing Solaris system. Unfortunately, the attempt fails in a rather dramatic way, spewing out thousands of "relocation remains"... I'm somewhat lost on what to do next, the documentation that came along with the Perl package is somewhat sparse. Anyone have suggestions? % uname -a
6
3011
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...
4
3706
by: billb | last post by:
I installed a perl extension for PHP to use some perl inside my php primarily because I have perl working with oracle and not php and oracle. So I want to use my old perl scripts, and use the functionality of php. The extension uses the '$perl->eval' function. i am kind of stuck with the syntax or how to put the php variable into the perl script. I have a form where the user puts in a grid reference. Then a php script that gets the...
21
34432
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Uploading files from a local computer to a remote web server has many useful purposes, the most obvious of which is the sharing of files. For example, you upload images to a server to share them with other people over the Internet. Perl comes ready equipped for uploading files via the CGI.pm module, which has long been a core module and allows users...
1
47477
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click on a link and after a moment or two a file download dialog box pops-up in your web browser and prompts you for some instructions, such as “open” or “save“. I’m going to show you how to do that using a perl script. What You Need Any recent...
0
9000
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, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8838
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
9577
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
9339
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
4713
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
4887
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3322
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2804
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2225
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.