Help for this page

Select Code to Download


  1. or download this
      sub htmlprint {
        my %arg = @_;
        $arg{file}->printf(
    ...
          $arg{text},
        );
      }
    
  2. or download this
      use Carp qw(croak);
      
      sub htmlprint {
    ...
          $arg{text},
        );
      }
    
  3. or download this
      use Carp qw(croak);
      use Scalar::Util qw(blessed);
      
    ...
          $arg{text},
        );
      }
    
  4. or download this
      use feature qw(state);
      use Type::Params qw(compile_named);
      use Types::Standard qw(FileHandle HasMethods Str);
    ...
          $arg->{text},
        );
      }
    
  5. or download this
      use Type::Params qw(compile_named);
      use Types::Standard qw(FileHandle HasMethods Str);
      
    ...
        
        ...;  # rest of the function goes here
      }
    
  6. or download this
      # will throw an exception because of 'size'
      htmlprint( file => $fh, text => "Hello world", colour => "red", size
    + => 7 );
    
  7. or download this
      use feature qw(state);
      use Type::Params 1.004000 qw(compile_named);
      use Types::Standard qw(FileHandle HasMethods Str);
    ...
        
        ...;  # rest of the function goes here
      }
    
  8. or download this
      use feature qw(state);
      use Type::Params 1.004000 qw(compile_named_oo);
      use Types::Standard qw(FileHandle HasMethods Str);
    ...
          $arg->text,                           # not $arg->{text}
        );
      }
    
  9. or download this
      use feature qw(state);
      use Type::Params 1.004000 qw(compile_named);
      use Types::Standard qw(FileHandle HasMethods Str);
    ...
        
        ...;  # rest of the function goes here
      }
    
  10. or download this
      use feature qw(state);
      use Type::Params 1.004000 qw(compile_named);
      use Types::Standard qw(FileHandle HasMethods Str Object);
    ...
        
        ...;  # rest of the function goes here
      }
    
  11. or download this
      use feature qw(state);
      use Type::Params 1.004000 qw(compile);
      use Types::Standard qw(FileHandle HasMethods Str);
    ...
      
      htmlprint($fh, "Hello world", "red");
      htmlprint($fh, "Hello world");   # defaults to black
    
  12. or download this
      package My::Types {
        use Type::Library -base;
        use Type::Utils -all;
    ...
            return $fh;
          };
      }
    
  13. or download this
      use feature qw(state);
      use Type::Params 1.004000 qw(compile_named);
      use Types::Standard qw(HasMethods Str);
    ...
        
        ...;  # rest of the function goes here
      }
    
  14. or download this
      htmlprint(
        file => "/tmp/out.html",  # will be coerced to a filehandle
        text => "Hello world",
      );
    
  15. or download this
      use feature qw(state);
      use Type::Params 1.004000 qw(compile_named);
      use Types::Standard qw(HasMethods Str);
    ...
        
        ...;  # rest of the function goes here
      }