Solved

can perl access CD-ROMS

Posted on 1998-06-03
4
149 Views
Last Modified: 2010-03-04
hello everyone
i dont think this is exactly a Perl question but, is there some way to access CD-ROM information via the web...im looking for any information on any of the ways to do this...basically all i need to know is if a person who requests a certain predefined file from their browsser can be delivered this file from a CD back to thier browser...
0
Comment
Question by:wired
  • 2
4 Comments
 
LVL 2

Accepted Solution

by:
tpryor earned 50 total points
ID: 1207368
Yes you can, as long as you have the correct correct path to the file on the cd rom, using server redirection. In perl simply...
print "Location: $file_path", "\n\n";

thats it,
t
0
 
LVL 84

Expert Comment

by:ozo
ID: 1207369
That would tell your browser to access the file if $file_path is a URL for the file
You'd get the same thing if you typed $file_path as the URL in your browser
if you want your Perl program to access the file, you can
  open(FILEHANDLE,"<$file_path") or die "Can't open $file_path because $!");

0
 

Author Comment

by:wired
ID: 1207370
thank you!
0
 
LVL 2

Expert Comment

by:tpryor
ID: 1207371
Both work.
It depends on what you want to do.
If you need to pre-process the file or wrap it in a html header and footer then the way ozo suggested is the way to go.
If no preprocessing is nessasary then use my way it will just serve it up as is.

t
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question