[oak perl] print Dumper \$|;

Belden Lyman blyman at iii.com
Wed Jan 15 18:30:44 CST 2003


Flush pipes, print $|:

     % perl -MData::Dumper -e '$|++; print Dumper \$|'
     $VAR1 = \'1';

Okay, I believe that.

Clog pipes, print $|:

     % perl -MData::Dumper -e '$|--; print Dumper \$|'
     $VAR1 = \'1';

Huh? Same value? That can't be right though, because
adding 1 gives different results:

     % perl -e '$|++; print $| + 1, "\n"; $|--; print $| + 1, "\n"'
     2
     1

By way of contrast, using $x rather than $| in the above examples
yields the expected results. So - what gives?

Belden

--
       "Don't write device drivers when you're on acid. Just... don't."
              -- overheard at Oakland.pm meeting, 14 Jan 2003




More information about the Oakland mailing list