[oak perl] Re: [sf-perl] print Dumper \$|;

George Woolley george at metaart.org
Wed Jan 15 22:04:53 CST 2003


Paul,
Kool! You posted on Oakland.pm.
      -- George

On Wednesday 15 January 2003 7:28 pm, Paul Makepeace wrote:
> On Wed, Jan 15, 2003 at 04:30:44PM -0800, Belden Lyman wrote:
> > 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
>
> This is a known perl oddity, and often used by golfers and obfuscators
> as a toggler.
>
> $ perl -le 'print "p",--$|,"ng!" for 1..4'
> p1ng!
> p0ng!
> p1ng!
> p0ng!
> $
>
> Paul




More information about the Oakland mailing list