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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
vaksCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Perl

From novice to tech pro — start learning today.