in reply to Re: What is $::| ?
in thread What is $::| ?

Right, but what is $main::|?  It doesn't seem to be the same as $|.

Replies are listed 'Best First'.
Re^3: What is $::| ?
by ikegami (Patriarch) on Feb 22, 2009 at 23:31 UTC

    It doesn't seem to be the same as $|.

    How did you arrive at that conclusion?

    Given that the vars in perlvar are package variables found in every package, they should be.

    >perl -le"for (0,1,0) { $|=$_; print $|, ${'main::|'} }" 00 11 00
    >perl -le"print \$| == \${'main::|'} ? 'same var' : 'diff var'" same var

    Update: Added second snippet.

      How did you arrive at that conclusion?

      I had simply tried

      $ perl -e '$|=1; print "$main::|\n";' |

      On second thought, it's obviously a parsing issue, i.e. $main::| is not being parsed as ${'main::|'}, but rather as $main::, so the '|' is being printed literally.

        You can see form the trailing "|" that you were referencing $main:: and not $main::|, so there's no ground for drawing conclusions about relation between $main::| and $|.