misterwhipple has asked for the wisdom of the Perl Monks concerning the following question:

The token $::| appears in the list of all known magic punctuation variables in PPI::Token::Magic. It's listed in PPI's changelog as a bug fix in January of 2005. It isn't in perlvar or—best I can tell—on this site. Under 5.10, this one-liner:
perl -e 'use strict; use warnings; print "$::|\n";'

...produces this output:

Use of uninitialized value $main:: in concatenation (.) or string at - +e line 1. |

And this:

my $thingy = $::|;

...won't even compile. So whatever it was, it doesn't seem to be magic anymore. What did $::| mean, and when was it in force?

Update: That string doesn't appear to appear in the source for perls 5.4 through 5.10.

cat >~/.brain </dev/the_answer

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

    $::x is short for $main::x

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

        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.