Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

open HTML file using Perl

Status
Not open for further replies.

tmffm

Technical User
Jun 12, 2007
10
We can open a file in Perl for reading or writing

is it possible to actually open an HTML file in a browser window using Perl?

So, instead of opening for reading or writing, open for viewing.
 
You mean on a website?

I think you can use wget and I know you can use LWP.
 
NOt on a website. On my PC. So, it need not be an HTML file. It could be any kind of file: html, gif, etc.
 
you mean like doing a system call to iexplorer and have it open the file?

`"C:\Program Files\Internet Explorer\iexplore.exe" somefile.blah';

 
Or just using the DOS start command.

How would I call these in Perl?
 
I just showed you..

`` or system() or exec() there's a bunch of different ways.

I'd link you to the documentation but I can't seem to get to perl.org right now.
 
thanks. I figured it out given your replies.

exec($file);

works
 
Just remember there are differences in all the different ways.. so you might want to read and figure out which one you really want..
 
I can get exec to work by calling it from the same directory the file is in but can't get it work with a complete path

telling me 'C:/Documents' is not recognized

$file = "C:/Documents and Settings/Administrator/Desktop/file.gif";

what would the correct syntax be? have searched online to no avail.
 
$file = '"C:/Documents and Settings/Administrator/Desktop/file.gif"';
is my guess. Windows needs the "'s.

Travis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top