![]() |
|
Think about Loose Coupling | |
PerlMonks |
Re^2: The print is output later after dieby eyepopslikeamosquito (Bishop) |
on Jan 29, 2022 at 02:21 UTC ( #11140946=note: print w/replies, xml ) | Need Help?? |
Nice example! I prefer autoflush because the intent is much clearer than messing with the $| global variable. As an aside, it's a shame Perl was originally released with so many evil global variables because by the time lexical file handles made it into Perl 5.6 a host of unfortunate idioms were in common use, such as:
Of course, such old coding horrors like this can be expressed more clearly nowadays with a lexical file handle (see also):
For more examples of historic interface design boo-boos, see the Some Examples of Interface Mistakes section at: On Interfaces and APIs
In Section
Seekers of Perl Wisdom
|
|