in reply to Re^9: why does push not default to $_?
in thread why does push not default to $_?

So the default pronoun is the "you" in imperative forms?

There's no default. It can equally be "you" (singular) and "you" (plural) and "we" (plural).

Anyway the direct object "it" is the equivalent to $_,

But the "it" isn't optional. "eat" and "eat it" are not synonymous.

I'm not sure why you guys are comparing English with Perl. There might be similarities, but the differences are more numerous. It's not helping you at all.

  • Comment on Re^10: why does push not default to $_?

Replies are listed 'Best First'.
Re^11: why does push not default to $_?
by LanX (Saint) on Dec 07, 2008 at 19:52 UTC
    > There might be similarities, but the differences are more numerous. It's not helping you at all.

    that's what I'm trying to show. Whenever I try to discuss about the inner mechanisms of perl, this myth arises:

    "Perl doesn't have to be logical, it's modelled after a human language"

    These are not contradictary goals!!!

    Cheers Rolf

      Just to be clear, I'm not trying to say Perl shouldn't be/isn't logical... I'm just pointing out some of the logical concepts that come from English where they're involved.

      Also, I tend to think that push having no default to $_ behavior makes sense, partly because it's a binary operator. Since it takes two objects, neither of which is necessarily a scalar, it seems that the sanest way of handling it, in a way that will require the least documentation to understand, is to insist on explicit arguments.

      for(split(" ","tsuJ rehtonA lreP rekcaH")){print reverse . " "}print "\b.\n";