- or download this
sub htmlprint {
my %arg = @_;
$arg{file}->printf(
...
$arg{text},
);
}
- or download this
use Carp qw(croak);
sub htmlprint {
...
$arg{text},
);
}
- or download this
use Carp qw(croak);
use Scalar::Util qw(blessed);
...
$arg{text},
);
}
- or download this
use feature qw(state);
use Type::Params qw(compile_named);
use Types::Standard qw(FileHandle HasMethods Str);
...
$arg->{text},
);
}
- or download this
use Type::Params qw(compile_named);
use Types::Standard qw(FileHandle HasMethods Str);
...
...; # rest of the function goes here
}
- or download this
# will throw an exception because of 'size'
htmlprint( file => $fh, text => "Hello world", colour => "red", size
+ => 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
}
- 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}
);
}
- 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
}
- 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
}
- 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
- or download this
package My::Types {
use Type::Library -base;
use Type::Utils -all;
...
return $fh;
};
}
- 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
}
- or download this
htmlprint(
file => "/tmp/out.html", # will be coerced to a filehandle
text => "Hello world",
);
- 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
}