[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

-t, -T on IO refs



Is this correct?

    use overload q/""/ => sub { warn "overload called" };

    my $x = bless \*STDOUT;
    warn "-r GLOB";     -r $x;
    warn "-t GLOB";     -t $x;
    warn "-T GLOB";     -T $x;

    my $y = bless *STDOUT{IO};
    warn "-r IO";       -r $y;
    warn "-t IO";       -t $y;
    warn "-T IO";       -T $y;

    __END__

    -r GLOB at overIO line 6.
    -t GLOB at overIO line 7.
    -T GLOB at overIO line 8.
    -r IO at overIO line 11.
    -t IO at overIO line 12.
    overload called at overIO line 3.
    overload called at overIO line 3.
    -T IO at overIO line 13.
    overload called at overIO line 3.

(-B is the same as -T, of course.) Even though -t and -T both only need
the filehandle part of the glob, they still fall back to stringifying if
passed an IO ref; and -t ends up calling stringify twice.

Oh, and while I'm there...

    ./perl -e'sub PVBM () { "foo" } index "f", PVBM; -t \PVBM'
    Assertion failed: (isGV_with_GP(_gvgp)), function Perl_pp_fttty,
    file pp_sys.c, line 3229.

I'll do a patch for that once I've had a chance to check all the other
occurences of isGV()...

Ben


[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]