in reply to P248 programming perl

1&2 are supposed to be the same. But 3&4 will confuse the parser if you right your own subroutine named Doggy.
1&2 are the same as 3&4.
$ perl -le 'print for 1&2, 3&4' 0 0

Replies are listed 'Best First'.
Re: [Joke] Re: P248 programming perl
by wackattack (Sexton) on Jul 05, 2005 at 05:57 UTC
    The title of my post is the page # and book name of where I got this code.

    "The Camel Book, officially known as Programming Perl, Third Edition, by Larry Wall et al"

    When I said 3& 4 might confuse the parsers I got that straight from the book. As for davorg's advice on 1, 2 & 4 would you care explaining?

    And brian_d_foy said: "Don't use the indirect object notation and you won't have to worry about it." Care to explain?
      The title of my post is the page # and book name of where I got this code.
      I'm not contending that...
      When I said 3& 4 might confuse the parsers I got that straight from the book. As for davorg's advice on 1, 2 & 4 would you care explaining?

      And brian_d_foy said: "Don't use the indirect object notation and you won't have to worry about it." Care to explain?

      If I must be sincere, I don't see why: did you notice that I took care specifying that mine was a Joke? I was referring to the Perl expressions 1&2 and 3&4 respectively, as you can see from the code supplied.

      However if there's anything you couldn't understand in the answers from those two monks, you should ask directly to them. As far as my personal opinion is concerned, I must admit that while I'm tempted occasionally to adopt indirect object notation1 myself, indeed most (and I mean most!) of the times it is the case to avoid doing so.

      1 See e.g. Speaking of indirect object notation....