You hit upon an (older) corner of perl's OOP syntax, the "indirect object" notation. Since flush is a method what your first code really translates to would be $gp->flush (which would be the proper replacement if you want to be explicit). In recent perls you can als disable it with no feature q{indirect}. See https://www.effectiveperlprogramming.com/2020/06/turn-off-indirect-object-notation/ for a bit more detailed explanation.
The cake is a lie.
The cake is a lie.
The cake is a lie.
In reply to Re: Why does "flush filehandle" work?
by Fletch
in thread Why does "flush filehandle" work?
by chengiz5
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |