Jump to content

Recommended Posts

Hi there,

 

  This is not really so much about PHP but I hope someone can help a little here.

 

Basicaly I want to learn PHP but I am on a course that insists I learn PERL so my question is this, Will I be able to learn both languages at the same time easy enough or am I going to get really confused and frustrated?

Link to comment
https://forums.phpfreaks.com/topic/38698-php-perl/
Share on other sites

I learned Perl first. It was a fun learning experience. At first thought, I would never use PHP. But, with about 6 months behind that first opinion, I'd say PHP is extremely more user-friendly for writing webpages. I don't do much of anything with Perl anymore.

 

I think you could learn both languages at the same time. The basic connection is with regular expressions. PHP has many PCRE functions (Perl-compatible regular expressions).

 

For learning PHP, I'd suggest reading the manual (duh!). Get to know the functions for different types of operations. Google, the PHP manual, and code examples are the best ways to learn.

Link to comment
https://forums.phpfreaks.com/topic/38698-php-perl/#findComment-185889
Share on other sites

Perl is thinking language, you can just about count all the core functions Perl has on your hands and toes. PHP is function based language (4687 functions PHP 5.0.1), where sometimes you can use 5 or more different functions to do the same exact thing. Learning Perl will help you become a true thinker, which is sometimes better than using a core function, because that function is slower than what you can code in pure scripting. Many will tell you, why reinvent the wheel! Because what already exists may not be the best approach to solving a new problem, especially seeing the scripting language core code base, changes all the time.

 

pif!

Link to comment
https://forums.phpfreaks.com/topic/38698-php-perl/#findComment-185921
Share on other sites

Perl is thinking language, you can just about count all the core functions Perl has on your hands and toes. PHP is function based language (4687 functions PHP 5.0.1), where sometimes you can use 5 or more different functions to do the same exact thing. Learning Perl will help you become a true thinker, which is sometimes better than using a core function, because that function is slower than what you can code in pure scripting. Many will tell you, why reinvent the wheel! Because what already exists may not be the best approach to solving a new problem, especially seeing the scripting language core code base, changes all the time.

 

pif!

That explains the popularity of PHP! It doesn't require much thinking and is therefore easy. :) There's a function to do it (ie everything) for you. LOL.

Link to comment
https://forums.phpfreaks.com/topic/38698-php-perl/#findComment-185924
Share on other sites

I only posted the truth, look at a simple example.

 

PHP file to array (single function)

 

<?PHP

$file = file ( './path/file.txt' );

?>

 

Perl file to array (io handle to push)

 

use strict;

my $file = "./path/file.txt";

open (IO, "< $file") or die "Can't open $file for read: $!";

my @line;

while (<IO>)
{
tr/\r\n//d; # line endings

push (@line, $_); # push the current line into the array
}

close IO or die "Cannot close $file: $!";

# @line holds the array of lines

 

You can do the same thing in PHP as Perl, but Perl doesn't have the function list, so you must think about how you would approach this in the best way. With PHP you know the best way is file();

Link to comment
https://forums.phpfreaks.com/topic/38698-php-perl/#findComment-185935
Share on other sites

That's a lot of Perl; how about:

 

use warnings;
use strict;
local @ARGV = 'file.txt';
$/ = "\n";
my @lines = <>;

 

Of course, depending on the file and how memory-friendly you want to be, there's lots of ways to achieve the same task. TMTOWTDI.

 

See this topic.

Link to comment
https://forums.phpfreaks.com/topic/38698-php-perl/#findComment-186017
Share on other sites

Honestly, I don't know because I haven't used Perl for the web yet. I've seen the extremes of both sides in debates, and in the topic I linked, other languages beside these two were suggested. I've worked in some areas that use C# and others that use J2EE.

 

Have you looked at the job market to see what is in demand for web developers?

You can find more opinions @ perlmonks.net.

Link to comment
https://forums.phpfreaks.com/topic/38698-php-perl/#findComment-186344
Share on other sites

So would you say that PERL is for someone interested in making web building a career/life and PHP is more for serious web builders but are not into it for a career of any kind?

 

I think that seems to be the conclusion.

 

Any language can make you a good living, but not any one language is good enough to do a enterprise service by it's self. PHP, Perl, ASP, .NET, Ruby, Python all have some really unique abilities, but when you develop you learn somethings are better done using a different language. For me I have made more monies, doing Perl work, but I also make money doing C#, C++ and the other scripting languages I listed. Perl has been my main source of income, because most of the systems that were built years ago, used Perl for it powerful text manipulation capabilities. Even today, Perl is still the back end king, but that's because the cost of using a newer alternative just to get 10% speed gain is not worth it for most systems that have been doing it the Perl way for many years. That not the only reason, but it is a driving force that keeps Perl running the majority of those old refined systems!

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/38698-php-perl/#findComment-186357
Share on other sites

I started web designing back in 2000. Back then, I was your standard n00b: "CS What?", "HT erm...HTSML...HTML, thats the one", I was designing pages in times new roman with big table cells everywhere -- your standard un-styled everything. Unleash the validators and they'd break through shear disgust.

 

Since then I've experimented with a few other languages, PHP being my more recent one, JavaScript documents, ASP, JSP, Python, even things like HTA's.

 

I've been designing and building websites for people for about the last year and had some very satisfied customers, which considering my age, I dont think is too bad. Honestly, I learn languages for fun because at the end of the day, if the site works how they want it to, the customer doesn't really care. They dont need to know how it works or why it works, as long as they know it works when they want it to and they know how to use the CMS you design in whatever language you're comfortable with.

 

PHP in my opinion is probably the best language for most dynamic websites, as i believe printf pointed out, it has something like 4687 different functions, some of which do the same thing, so you even get choice. Obviously, no single person is likely to know all of these, but they're out there, making life easier if you stumble across them.

 

Perl I've never tried, although I was going to. I just didn't see the point really because, correct me if i'm wrong, but whatever Perl can do, I'm pretty sure can be done with PHP just as easily if not easier. Therefore, if your course requires you to know Perl, learn it, but unless you're interested in it having started learning, I personally would leave it be afterwards.

 

One of the things that makes a business successful is flexabilty, you have to be adaptable which, to me, promotes PHP: its flexable.

 

*END OF SERMON* xD

Link to comment
https://forums.phpfreaks.com/topic/38698-php-perl/#findComment-186397
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.