Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I see some of merlyn's cgi code containing "$| = 1;" but I never understood what it was for.

    At least, that is where I think I saw it...
    • Yep, it's part of the standard header in all of his programs, not just his CGI ones. (If you read more than one of his columns, he copies and pastes that explanation.)

      I think it's an unnecessary pessimization in terms of clarity and performance. Most of the time, buffering isn't a problem. Only change the default when it is.

      • by Crag (6470) on 2006.08.09 8:42 (#49261)
        "Most of the time, buffering isn't a problem. Only change the default when it is."

        This seems like an excellent rule of thumb even for a more general context. Maybe I'll leave "use strict; use warnings;" out of my templates and only put them in code while its tests aren't passing.

        (I'm only about 20% serious.)

        • Ah, but my default rule of thumb has an implicit "Assuming the default is good and useful..." preface. I can see now that my buffering rule of thumb is one of the 20% of cases where that clause should be explicit.