creating an html file of 2 other files

Hi ! I'm creating an html file by reading file1.txt in @lines.
the I print @lines. after that I print some scalars and then
I print the second file. after the print @2ndlines I'm using die;
to stop the script. unfortunately perl writes "died at ..." into my
new html doc. it writes the whole 2nd part without problems but
always at the same position it writes "died" ! this destroys my
java scripts :-( you can check out the problem at www.milleniumserver.de/plw  (change to software than choose
"einloggen" in the service section ! name = ee passwort = ee)

thanks
ItsMe
ItsMeAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
vaksConnect With a Mentor Commented:
Below is part of a perl script for downloading files.

(Use an URL ending in /filename.ext in the link to it. Otherwise the file will have the wrong name when the user is saving it (it will have the same name as the perl script).
(Example: <a href="/cgi-bin/download.pl/myfile.zip">Download Myfile.zip</a>))

Regards
Vaks
--------
if ($password eq 'foobar')
{
print "Content-type: application/zip\n\n";
open (FILE,"file.zip") ||die "Can't open file";
print join('',<FILE>);
close (FILE);
}
else
{
print "Content-type: text/html\n\n";
print "Wrong password";
}

0
 
vaksCommented:
Use exit instead of die?

Regards
Vaks
0
 
prakashk021799Commented:
Replace the die with:

die "\n";

This will prevent that message.

If you are just using die to exit the program,  then 'exit' is more appropriate than die, as vaks has suggested above.
0
 
ItsMeAuthor Commented:
cool, thanks a lot ! then I got a 2nd question. who answers it will get the points. i want some users download files. but they have to login with their account no and password to protect these files from others, so I can't use normal links. how can I use a pearl script so send a file to the user ??? (The user should click on a link (ps: how do I replace the submit button of an form by a normal text ?) ... does it work with print "loaction:" or something like that ?

regards
ItsMe
0
 
ItsMeAuthor Commented:
thanks for your solutions !
can you tell me how to use a text instead of a button ? the text must submit a form with a hidden filed (where the password is in)

regards
ItsMe
0
All Courses

From novice to tech pro — start learning today.