Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What he probably meant to say is:

In Perl, you can pass only one kind of argument to a subroutine: a scalar. To pass any other kind of argument, you need to convert it to a scalar. You do that by passing a reference to it. A reference to anything is a scalar. If you're a C programmer you can think of a reference as a pointer (sort of).

That's from

http://www.troubleshooters.com/codecorn/littperl/perlsub.htm

... which I found because I, unlike the OP, happen to remember that the thing-which-is-sort-of-like-a-pointer-only-not-really in Perl is called a reference.

So let me help the original author: What he meant to say is that "Perl has things that remind me of pointers, but have a different name, and that aren't exactly pointers, but are nearly as confusing as real pointers, especially to someone who just wants to put up a simple web page in five minutes."



But PHP is just as confusing. When you say:

    foo("bar", "baz", "quux")
and

    foo(array("bar", "baz", "quux"))
you have the same confusion problem as Perl. Except there's no explanation for it at all.

I guess if you don't know anything about programming and never hope to, "Oh, well, uh..." is good enough.

This makes me sad.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: