------------------------------------------------ On Thu, 4 Sep 2003 10:01:43 -0500, "Dan Muey" <[EMAIL PROTECTED]> wrote:
> Howdy list! > I was wondering...(imagine that!) > > If I have in my script: > > #!/usr/bin/perl -w > use strict; > use ModuleWhatever; > > And ModuleWhatever has: > > package ModuleWhatever; > $|++; > > Would that turn on autoflush for the rest of the script? > IE is the above example the same as doing : > > #!/usr/bin/perl -w > use strict; > $|++; > > Then there's always the: Do I use $|++; or $|=1; > On top of what Peter chimed in with which was well said, since this is a "what if" sort of question I would suggest using the IO::Handle methods (such as 'autoflush') and not dorking with $| at all, at least I presume that interface works directly on the handle rather than using some combination that might leave $| in an unstable sort since that would be silly. There are those "I don't want to have to install a mdoule that will make my life easier since I am running an ancient Perl that doesn't come with the now standard module" or the "it might slow my compile time down to a 'crawl'" arguments but this is a hypothetical, so hypothetically you are running your program on the absolute newest Perl and on the world's second fastest computer (why second?, well naturally I own the first fastest!, hypothetically) so these shouldn't be big concerns. Personally if I have gone to the trouble of wrapping the code in a module (which likely I have) I won't mind going the further distan! ce of using the IO::Handle interface. http://danconia.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
