SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG
DONATE




YUM REPOSITORY

 
 

MAN page from Mandriva 2010 perl-HTML-Display-0.390.0-1mdv2010.0.noarch.rpm

HTML::Display

Section: User Contributed Perl Documentation (3)
Updated: 2007-10-20
Index 

NAME

HTML::Display - display HTML locally in a browser 

SYNOPSIS

  use strict;  use HTML::Display;  # guess the best value from $ENV{PERL_HTML_DISPLAY_CLASS}  # or $ENV{PERL_HTML_DISPLAY_COMMAND}  # or the operating system, in that order  my $browser = HTML::Display->new();  warn "# Displaying HTML using " . ref $browser;  my $location = "http://www.google.com/";  $browser->display(html => $html, location => $location);  # Or, for a one-off job :  display("<html><body><h1>Hello world!</h1></body></html>");
 

DESCRIPTION

This module abstracts the task of displaying HTML to the user. Thedisplaying is done by launching a browser and navigating it to eithera temporary file with the HTML stored in it, or, if possible, bypushing the HTML directly into the browser window.

The module tries to automagically select the ``correct'' browser, butif it dosen't find a good browser, you can modify the behaviour bysetting some environment variables :

  PERL_HTML_DISPLAY_CLASS

If HTML::Display already provides a class for the browser you want touse, setting "PERL_HTML_DISPLAY_CLASS" to the name of the class willmake HTML::Display use that class instead of what it detects.

  PERL_HTML_DISPLAY_COMMAND

If there is no specialized class yet, but your browser can be controlledvia the command line, then setting "PERL_HTML_DISPLAY_COMMAND" to thestring to navigate to the URL will make HTML::Display use a "system()"call to the string. A %s in the value will be replaced with the nameof the temporary file containing the HTML to display. 

%HTML::Display::os_default

The hash %HTML::Display::os_default contains pairs of class namesfor the different operating systems and routines that test whetherthis script is currently running under it. If you you want to dynamicallyadd a new class or replace a class (or the rule), modify %os_default :

  # Install class for MagicOS  $HTML::Display::os_default{"HTML::Display::MagicOS"}    = sub { $^O =~ qr/magic/i };
 

__PACKAGE__->new %ARGS

 

$browser->display( %ARGS )

Will display the HTML. The following arguments are valid :

  base     => Base to which all relative links will be resolved  html     => Scalar containing the HTML to be displayed  file     => Scalar containing the name of the file to be displayed                                                This file will possibly be copied into a temporary file!  location    (synonymous to base)

If only one argument is passed, then it is taken as if

  html => $_[0]

was passed. 

EXPORTS

The subroutine "display" is exported by default 

COMMAND LINE USAGE

Display some HTML to the user :

  perl -MHTML::Display -e "display '<html><body><h1>Hello world</body></html>'"

Display a web page to the user :

  perl -MLWP::Simple -MHTML::Display -e "display get 'http://www.google.com'"

Display the same page with the images also working :

  perl -MLWP::Simple -MHTML::Display -e "display html => get('http://www.google.com'),                                                 location => 'http://www.google.com'"
 

AUTHOR

Copyright (c) 2004-2007 Max Maischein "<corionAATTcpan.org>" 

LICENSE

This module is released under the same terms as Perl itself.


 

Index

NAME
SYNOPSIS
DESCRIPTION
%HTML::Display::os_default
__PACKAGE__->new %ARGS
$browser->display( %ARGS )
EXPORTS
COMMAND LINE USAGE
AUTHOR
LICENSE

This document was created byman2html,using the manual pages.