in reply to Re^3: Why does "flush filehandle" work? (indirect object)
in thread Why does "flush filehandle" work?

But seems like technically you are right.

And you were under-correct. (Thanks etj!)

If print SCALAR LIST, print BAREWORD LIST and print BLOCK LIST were method calls,

print, say, map, grep and sort are not indirect method calls despite having name BAREWORD and name BLOCK calling conventions like indirect method calls. They are not technically different; they are very different.

Replies are listed 'Best First'.
Re^5: Why does "flush filehandle" work? (indirect object)
by LanX (Saint) on Jan 30, 2025 at 11:21 UTC
    IMHO this is all a result of piggybacking OO onto Perl 4 syntax° which already had filehandles, and I'm disappointed about the bad implementation.

    The fact that print $fh and $fh->print can divert is a serious design flaw in my books.

    Even if print is implemented as a special cased monster for backwards compatibility, print $fh should do the same like $fh->print

    Let me reiterate "you are technically correct" or in my words Perl is buggy here.

    > And you were under-correct. (Thanks etj!)

    Regarding etj, he hasn't contributed anything technical yet and has obviously beef with me.

    I have no problems admitting when I'm wrong, this is just a very ugly case to describe how wrong everything is.

    But if we want to get personal, you are the one notorious to fight till Re:50+ before admitting to be wrong or compromising that views may differ.

    > CORE overrides wouldn't come into play.

    ORLY? Please humor me and demonstrate a core override of print and say.

    They are not possible, exactly because of their weird implementation.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    see Wikisyntax for the Monastery

    °) For the record, I tried finding a Perl 4 language reference but failed, any hints/links?

Re^5: Why does "flush filehandle" work? (indirect object)
by etj (Priest) on Jan 31, 2025 at 02:25 UTC
    You're welcome!