Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
What are your views?

PHP isn't Perl.

For Perl programmers, its apparent similarities to Perl tend to be more frustrating than helpful because they are only cosmetic similarities. Under the hood, the languages are very different from each other.

The example you give is usually the first that Perlers faced with learning PHP run into. It is also usually the first to be forgotten once familiarity starts to settle in. One that I banged my head on for a while was that Perl's concept of context doesn't translate into PHP. For instance, I had a PHP function defined to take multiple arguments and then spent far too long trying to figure out why I couldn't shove all those arguments into an array and call myfunc($array)... duh.

I think most experienced Perl programmers who are introduced to PHP for the first time tend to view PHP as an inferior if not downright dysfunctional Perl¹. It isn't. It's actually a decent language, designed primarily for a limited domain, that meets its requirements fairly well. But, PHP isn't Perl. If you keep that in mind while you learn it, you might have an easier time of it.

1. Well, I did anyway.

-sauoq
"My two cents aren't worth a dime.";

In reply to Re: Perl is more intuitive by sauoq
in thread Perl is more intuitive by kiat

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (None)
    As of 2024-04-25 03:58 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found