Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    say $fh-> can( "print" ) ? "yes" : "no";    # yes
    
    say "no" unless blessed $fh;                # no
    
  2. or download this
    use strict;
    use warnings;
    ...
    say $fh-> can( "print" ) ? "yes" : "no";    # no
    autoflush $fh 1;
    say $fh-> can( "print" ) ? "yes" : "no";    # yes
    
  3. or download this
    $ perl -MO=Deparse -e '
    > open my $fh, "+>", undef;
    ...
    print $fh 123;
    $fh->print(123);
    -e syntax OK
    
  4. or download this
    use strict;
    use warnings;
    ...
    say $foo-> can( "print" ) ? "yes" : "no";   # yes
    say $bar-> can( "print" ) ? "yes" : "no";   # yes
    }
    
  5. or download this
    use strict;
    use warnings;
    ...
    __END__
    
    GLOB(0x1ea3a0) is missing the 'print' method
    
  6. or download this
    Use of uninitialized value $list in concatenation (.) or string at C:/
    +berrybrew/5.26.0_64_PDL/perl/vendor/lib/Specio/Constraint/Role/CanTyp
    +e.pm line 58.
    GLOB(0x2d6a3a0) is missing the  methods
    
  7. or download this
    An unblessed reference (GLOB(0x560dc7cc1348)) will never pass an AnyCa
    +n check (wants print)
    
  8. or download this
    my $fh = IO::File-> new( 'some.log', 'w' );