in reply to run file

If you are under Windows, there is the simple minded way of simply "starting" the file through the associated program :

my $htmlfile = "c:\\test.html"; system(qq{start "$htmlfile"});

If you are not on Windows, or want to keep up some semblance of portability, there is my module HTML::Display, which tries to make displaying HTML in a browser somewhat less platform dependent, but it is not yet distributed stand-alone.

perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web

Replies are listed 'Best First'.
Re: Re: run file
by Anonymous2003 (Initiate) on Aug 18, 2003 at 11:07 UTC
    I am under solaris and i use perl version 5004.04!I want to run the html file! thank you!
      One doesn't "run html files". HTML files contain data; HTML is not a programming language. If you mean you want to display an HTML file from within your Perl program, the following ought to work:
      system netscape => "file:///home/you/path/to/file.html";

      assuming that netscape is in your PATH.

      Or, if netscape is already running, you do something like:

      system netscape => 'remote', 'openURL(file:///home/you/path/to/fil +e.html,new_window)';

      Abigail

      A reply falls below the community's threshold of quality. You may see it by logging in.
      A reply falls below the community's threshold of quality. You may see it by logging in.