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

> 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

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

Replies are listed 'Best First'.
Re^12: why does push not default to $_?
by pobocks (Chaplain) on Dec 08, 2008 at 04:29 UTC

    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";